コード例 #1
0
ファイル: test_nix.py プロジェクト: davidmiller/ffs
 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)
コード例 #2
0
ファイル: test_path.py プロジェクト: davidmiller/ffs
 def test_with_tmp_contents(self):
     "Should kill directory contents"
     with Path.temp() as p:
         val = str(p)
         touch(p + 'my.txt')
         self.assertTrue(os.path.exists(str(p + 'my.txt')))
     self.assertFalse(os.path.exists(val))
コード例 #3
0
ファイル: test_nix.py プロジェクト: davidmiller/ffs
 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
ファイル: test_nix.py プロジェクト: pombredanne/ffs-1
 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
ファイル: test_nix.py プロジェクト: pombredanne/ffs-1
 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
ファイル: test_path.py プロジェクト: pombredanne/ffs-1
 def test_with_tmp_contents(self):
     "Should kill directory contents"
     with Path.temp() as p:
         val = str(p)
         touch(p + 'my.txt')
         self.assertTrue(os.path.exists(str(p + 'my.txt')))
     self.assertFalse(os.path.exists(val))
コード例 #7
0
ファイル: test_nix.py プロジェクト: davidmiller/ffs
 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)
コード例 #8
0
ファイル: test_nix.py プロジェクト: pombredanne/ffs-1
 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)
コード例 #9
0
ファイル: test_path.py プロジェクト: pombredanne/ffs-1
 def test_iter_dir(self):
     "Iterate through lines in a file"
     p = Path(self.tdir)
     touch(p + 'foo.txt')
     touch(p + 'bar.txt')
     i = ['foo.txt', 'bar.txt']
     for branch in p:
         self.assertIn(branch, i)
コード例 #10
0
ファイル: test_path.py プロジェクト: davidmiller/ffs
 def test_iter_dir(self):
     "Iterate through lines in a file"
     p = Path(self.tdir)
     touch(p + 'foo.txt')
     touch(p + 'bar.txt')
     i = ['foo.txt', 'bar.txt']
     for branch in p:
         self.assertIn(branch, i)
コード例 #11
0
ファイル: test_nix.py プロジェクト: davidmiller/ffs
 def test_touch_path(self):
     "Create from a Path object"
     filestr = self.tdir + '/foo.txt'
     filepath = Path(filestr)
     nix.touch(filepath)
     self.assertTrue(os.path.isfile(filestr))
コード例 #12
0
ファイル: test_path.py プロジェクト: pombredanne/ffs-1
 def setUp(self):
     tmpath = self.tmpath = tempfile.mktemp()
     self.tdir = tempfile.mkdtemp()
     touch(tmpath)
コード例 #13
0
 def setUp(self):
     self.tfile = tempfile.mktemp()
     self.tdir = tempfile.mkdtemp()
     nix.touch(self.tfile)
     nix.mkdir_p(self.tdir)
     self.fs = filesystem.DiskFilesystem()
コード例 #14
0
ファイル: test_nix.py プロジェクト: pombredanne/ffs-1
 def setUp(self):
     self.tdir = tempfile.mkdtemp()
     p = Path(self.tdir)
     nix.touch(p + 'foo.txt')
     nix.touch(p + 'bar.txt')
コード例 #15
0
ファイル: test_nix.py プロジェクト: pombredanne/ffs-1
 def setUp(self):
     self.tdir = tempfile.mkdtemp()
     self.src = self.tdir + '/target'
     nix.touch(self.src)
コード例 #16
0
ファイル: test_path.py プロジェクト: davidmiller/ffs
 def setUp(self):
     tmpath = self.tmpath = tempfile.mktemp()
     self.tdir = tempfile.mkdtemp()
     touch(tmpath)
コード例 #17
0
ファイル: test_nix.py プロジェクト: davidmiller/ffs
 def setUp(self):
     self.tdir = tempfile.mkdtemp()
     self.src = self.tdir  + '/target'
     nix.touch(self.src)
コード例 #18
0
ファイル: test_path.py プロジェクト: davidmiller/ffs
 def test_contents_dir(self):
     "list of files"
     p = Path(self.tdir)
     touch(p + 'myfile.txt')
     self.assertIn(self.tdir + '/myfile.txt', p.contents)
     self.assertEqual(1, len(p.contents))
コード例 #19
0
ファイル: test_path.py プロジェクト: pombredanne/ffs-1
 def test_contents_dir(self):
     "list of files"
     p = Path(self.tdir)
     touch(p + 'myfile.txt')
     self.assertIn(self.tdir + '/myfile.txt', p.contents)
     self.assertEqual(1, len(p.contents))
コード例 #20
0
ファイル: test_nix.py プロジェクト: pombredanne/ffs-1
 def test_touches(self):
     "Create a file"
     filepath = self.tdir + '/foo.txt'
     nix.touch(filepath)
     self.assertTrue(os.path.isfile(filepath))
コード例 #21
0
ファイル: test_nix.py プロジェクト: davidmiller/ffs
 def test_touches(self):
     "Create a file"
     filepath = self.tdir + '/foo.txt'
     nix.touch(filepath)
     self.assertTrue(os.path.isfile(filepath))
コード例 #22
0
ファイル: test_nix.py プロジェクト: davidmiller/ffs
 def setUp(self):
     self.tdir = tempfile.mkdtemp()
     p = Path(self.tdir)
     nix.touch(p + 'foo.txt')
     nix.touch(p + 'bar.txt')
コード例 #23
0
ファイル: test_nix.py プロジェクト: pombredanne/ffs-1
 def test_touch_path(self):
     "Create from a Path object"
     filestr = self.tdir + '/foo.txt'
     filepath = Path(filestr)
     nix.touch(filepath)
     self.assertTrue(os.path.isfile(filestr))
コード例 #24
0
ファイル: filesystem.py プロジェクト: pombredanne/ffs-1
 def touch(self, resource):
     return nix.touch(resource)