'''
Created on Apr 16, 2015

@author: yongk.kim
'''
import unittest

from pai.interface import Adb


class TestAdb(unittest.TestCase):
    def testAdbShell(self):
        self.assertEqual(Adb().shell('echo yongk').strip('\r\n'), 'yongk')
    '''
    classdocs
    '''
    def testAdbDevices(self):
        print Adb().getDevices()
    
    def testAdbRoot(self):
        self.assertEqual(Adb().root(), False)
        
    def testsvc(self):
        test = Adb()
        result = test.svc('wifi ', 'enable')
        print 'yongk: ', result
        self.assertTrue(result)
    def testgetprop(self):
        test = Adb()
        boot, logd = test.getProp('sys.boot_completed', 'init.svc.logd')
        self.assertEqual(boot, '1\r\n')
        self.assertEqual(logd, 'running\r\n')
        
if __name__ == '__main__':
    unittest.main()