autotests: Replace strings with constants

This commit is contained in:
Tim Kourt 2016-06-03 16:13:45 -07:00 committed by Denis Kenzior
parent 16839f2ca0
commit 2b1e820062
1 changed files with 7 additions and 5 deletions

View File

@ -30,9 +30,10 @@ class TestConnectDisconnect(unittest.TestCase):
# start simpleAgent # start simpleAgent
proc = Popen([sys.executable, '../utility/simpleAgent.py']) proc = Popen([sys.executable, '../utility/simpleAgent.py'])
time.sleep(2) time.sleep(2)
network = dbus.Interface(bus.get_object("net.connman.iwd", network = dbus.Interface(bus.get_object(utility.IWD_SERVICE,
networkToConnect), networkToConnect),
"net.connman.iwd.Network") utility.IWD_NETWORK_INTERFACE)
status = utility.connect(networkToConnect, self, mainloop, bus) status = utility.connect(networkToConnect, self, mainloop, bus)
if status == False: if status == False:
@ -65,11 +66,12 @@ class TestConnectDisconnect(unittest.TestCase):
def test_connectDisconnect(self): def test_connectDisconnect(self):
logger.info(sys._getframe().f_code.co_name) logger.info(sys._getframe().f_code.co_name)
while (True): while (True):
if bus.name_has_owner('net.connman.iwd') == True: if bus.name_has_owner(utility.IWD_SERVICE) == True:
break break
self.doConnectDisconnect() self.doConnectDisconnect()
#watch doesn't seem to work. So used name_has_owner #watch doesn't seem to work. So used name_has_owner
#watch = bus.watch_name_owner("net.connman.iwd",self.doConnectDisconnect) #watch = bus.watch_name_owner(utility.IWD_SERVICE,
# self.doConnectDisconnect)
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):