Пример #1
0
 def test_whichgen_verbose(self):
     testdir = self.testdirs[0].name
     arg = 'whichtestapp1'
     matches = list(_which.whichgen(arg, path=[testdir], verbose=True))
     assert len(matches) == 1
     match, from_where = matches[0]
     assert self._file_match(match, os.path.join(testdir, arg))
     assert from_where == 'from given path element 0'
Пример #2
0
 def test_whichgen_multiple(self):
     testdir0 = self.testdirs[0].name
     testdir1 = self.testdirs[1].name
     arg = 'whichtestapp1'
     matches = list(_which.whichgen(arg, path=[testdir0, testdir1]))
     assert len(matches) == 2
     assert self._file_match(matches[0][0], os.path.join(testdir0, arg))
     assert self._file_match(matches[1][0], os.path.join(testdir1, arg))
Пример #3
0
 def test_whichgen_multiple(self):
     testdir0 = self.testdirs[0].name
     testdir1 = self.testdirs[1].name
     arg = 'whichtestapp1'
     matches = list(_which.whichgen(arg, path=[testdir0, testdir1]))
     assert len(matches) == 2
     assert self._file_match(matches[0], os.path.join(testdir0, arg))
     assert self._file_match(matches[1], os.path.join(testdir1, arg))
Пример #4
0
 def test_whichgen_verbose(self):
     testdir = self.testdirs[0].name
     arg = 'whichtestapp1'
     matches = list(_which.whichgen(arg, path=[testdir], verbose=True))
     assert len(matches) == 1
     match, from_where = matches[0]
     assert self._file_match(match, os.path.join(testdir, arg))
     assert from_where == 'from given path element 0'
Пример #5
0
 def test_whichgen_failure(self):
     testdir = self.testdirs[0].name
     arg = 'not_a_file'
     matches = list(_which.whichgen(arg, path=[testdir]))
     assert len(matches) == 0
Пример #6
0
 def test_whichgen(self):
     testdir = self.testdirs[0].name
     arg = 'whichtestapp1'
     matches = list(_which.whichgen(arg, path=[testdir]))
     assert len(matches) == 1
     assert self._file_match(matches[0], os.path.join(testdir, arg))
Пример #7
0
 def test_whichgen_ext_success(self):
         testdir = self.testdirs[0].name
         arg = 'whichtestapp2'
         matches = list(_which.whichgen(arg, path=[testdir], exts = ['.wta']))
         assert len(matches) == 1
         assert self._file_match(matches[0], os.path.join(testdir, arg))
Пример #8
0
 def test_whichgen_ext_failure(self):
     testdir = self.testdirs[0].name
     arg = 'whichtestapp2'
     matches = list(_which.whichgen(arg, path=[testdir]))
     assert len(matches) == 0
Пример #9
0
 def test_whichgen_failure(self):
     testdir = self.testdirs[0].name
     arg = 'not_a_file'
     matches = list(_which.whichgen(arg, path=[testdir], exts=self.exts))
     assert len(matches) == 0
Пример #10
0
 def test_whichgen(self):
     testdir = self.testdirs[0].name
     arg = 'whichtestapp1'
     matches = list(_which.whichgen(arg, path=[testdir], exts=self.exts))
     assert len(matches) == 1
     assert self._file_match(matches[0][0], os.path.join(testdir, arg))
Пример #11
0
 def test_whichgen_ext_success(self):
     testdir = self.testdirs[0].name
     arg = 'whichtestapp2'
     matches = list(_which.whichgen(arg, path=[testdir], exts=['.wta']))
     assert len(matches) == 1
     assert self._file_match(matches[0][0], os.path.join(testdir, arg))
Пример #12
0
 def test_whichgen_ext_failure(self):
     testdir = self.testdirs[0].name
     arg = 'whichtestapp2'
     matches = list(_which.whichgen(arg, path=[testdir]))
     assert len(matches) == 0