Most, if not all, the SUTAgent tests use POSIX-style paths for local file access. This means they won't execute properly on Windows. They should use os.path() for manipulating local files, and the posixpath module for manipulating files on the device (since it is a SUTAgent requirement that all paths be presented in POSIX style, regardless of the device's platform).
Created attachment 648915 [details] [diff] [review] fix the paths; improve the code style Switched the paths, fixed newlines, indentation, line lengths. Ugly work :(.
Attachment #648915 - Flags: review?(mcote)
Also, this patch is incremental, assumes the one in #778366 is applied.
Comment on attachment 648915 [details] [diff] [review] fix the paths; improve the code style Review of attachment 648915 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for doing this. :) Looks good, just tiny little nits. You can push after addressing them; no need for re-review. ::: mozdevice/sut_tests/genfiles.py @@ +66,4 @@ > > > def clean_test_files(): > + ds = [os.path.join('test-files', d) for d in ['push1', 'push2']] Tiny nit: probably more appropriate to use a tuple for ('push1', 'push2'). @@ +72,5 @@ > shutil.rmtree(d) > except OSError: > pass > > + fs = [os.path.join('test-files', f) for f in ['mybinary.zip', 'mytext.zip']] Same as above. ::: mozdevice/sut_tests/test_info.py @@ +12,5 @@ > + def runTest(self): > + """ This tests the "info" command > + """ > + cmds = ['os', 'id', 'systime', 'uptime', 'screen', > + 'memory', 'power', 'process'] Technically this should probably be a tuple as well. ::: mozdevice/sut_tests/test_isdir.py @@ +22,5 @@ > self.dm.mkDir(testdir) > self.assertTrue(self.dm.isDir(testdir)) > + self.dm.pushFile(os.path.join('test-files', 'mytext.txt'), > + posixpath.join(testdir, 'mytext.txt')) > + self.assertFalse(self.dm.isDir(posixpath.join(testdir, '/mytext.txt'))) Remove the /.
Attachment #648915 - Flags: review?(mcote) → review+
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.