Пример #1
0
 def test_ls_almost_all(self):
     "Should see most dotfiles"
     nix.touch(Path(self.tdir) + '.dotrc')
     self.assertTrue(os.path.isfile(self.tdir + '/.dotrc'))
     contents = nix.ls(self.tdir, almost_all=True)
     contents.sort()
     self.assertEqual(['.dotrc', 'bar.txt', 'foo.txt'], contents)
Пример #2
0
 def test_ls_a_ignore_backups(self):
     "Should ignore ~ files even with all"
     nix.touch(Path(self.tdir) + 'dotrc~')
     self.assertTrue(os.path.isfile(self.tdir + '/dotrc~'))
     contents = nix.ls(self.tdir, ignore_backups=True, all=True)
     contents.sort()
     self.assertEqual(['.', '..', 'bar.txt', 'foo.txt'], contents)
Пример #3
0
 def test_ls_a_ignore_backups(self):
     "Should ignore ~ files even with all"
     nix.touch(Path(self.tdir) + 'dotrc~')
     self.assertTrue(os.path.isfile(self.tdir + '/dotrc~'))
     contents = nix.ls(self.tdir, ignore_backups=True, all=True)
     contents.sort()
     self.assertEqual(['.', '..', 'bar.txt', 'foo.txt'], contents)
Пример #4
0
 def test_ls_dotfile(self):
     "Shouldn't see dotfiles"
     nix.touch(Path(self.tdir) + '.dotrc')
     self.assertTrue(os.path.isfile(self.tdir + '/.dotrc'))
     contents = nix.ls(Path(self.tdir))
     contents.sort()
     self.assertEqual(['bar.txt', 'foo.txt'], contents)
Пример #5
0
 def test_ls_almost_all(self):
     "Should see most dotfiles"
     nix.touch(Path(self.tdir) + '.dotrc')
     self.assertTrue(os.path.isfile(self.tdir + '/.dotrc'))
     contents = nix.ls(self.tdir, almost_all=True)
     contents.sort()
     self.assertEqual(['.dotrc', 'bar.txt', 'foo.txt'], contents)
Пример #6
0
 def test_ls_dotfile(self):
     "Shouldn't see dotfiles"
     nix.touch(Path(self.tdir) + '.dotrc')
     self.assertTrue(os.path.isfile(self.tdir + '/.dotrc'))
     contents = nix.ls(Path(self.tdir))
     contents.sort()
     self.assertEqual(['bar.txt', 'foo.txt'], contents)
Пример #7
0
 def test_ls_path(self):
     "list files in dir"
     contents = nix.ls(Path(self.tdir))
     contents.sort()
     self.assertEqual(['bar.txt', 'foo.txt'], contents)
Пример #8
0
 def ls(self, resource, all=None):
     return nix.ls(resource, all=all)
Пример #9
0
 def test_ls_path(self):
     "list files in dir"
     contents = nix.ls(Path(self.tdir))
     contents.sort()
     self.assertEqual(['bar.txt', 'foo.txt'], contents)