Skip to content

Commit

Permalink
Removing test for feature that is not yet added
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Dec 9, 2015
1 parent fb4a2f4 commit 1537460
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions tests/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class TestLocalPath:
longpath = local.path("/some/long/path/to/file.txt")

def test_name(self):
name = self.longpath.name
assert isinstance(name, six.string_types)
Expand Down Expand Up @@ -115,7 +115,7 @@ def test_parts(self):
assert parts == ('C:\\', 'some', 'long', 'path', 'to', 'file.txt')
else:
assert parts == ('/', 'some', 'long', 'path', 'to', 'file.txt')

@pytest.mark.usefixtures("testdir")
def test_iterdir(self):
cwd = local.path('.')
Expand All @@ -127,18 +127,18 @@ def test_stem(self):
assert self.longpath.stem == "file"
p = local.path("/some/directory")
assert p.stem == "directory"

def test_root_drive(self):
pathlib = pytest.importorskip("pathlib")
pl_path = pathlib.Path("/some/long/path/to/file.txt").absolute()
assert self.longpath.root == pl_path.root
assert self.longpath.drive == pl_path.drive

p_path = local.cwd / "somefile.txt"
pl_path = pathlib.Path("somefile.txt").absolute()
assert p_path.root == pl_path.root
assert p_path.drive == pl_path.drive

def test_compare_pathlib(self):
pathlib = pytest.importorskip("pathlib")
def filename_compare(name):
Expand Down Expand Up @@ -173,6 +173,7 @@ def test_touch(self):


def test_copy_override(self):
"""Edit this when override behavior is added"""
with local.tempdir() as tmp:
one = tmp / 'one'
one.touch()
Expand All @@ -183,21 +184,14 @@ def test_copy_override(self):
assert one.is_file()
assert two.is_file()

one.write(b'lala')
two.write(b'baba')
with pytest.raises(TypeError):
one.copy(two)

one.copy(two, override = True)
assert one.read() == b'lala'

def test_copy_nonexistant_dir(self):
with local.tempdir() as tmp:
one = tmp / 'one'
one.write(b'lala')
two = tmp / 'two' / 'one'
three = tmp / 'three' / 'two' / 'one'

one.copy(two)
assert one.read() == two.read()
one.copy(three)
Expand Down Expand Up @@ -249,7 +243,7 @@ def test_imports(self):
def test_get(self):
assert str(local['ls']) == str(local.get('ls'))
assert str(local['ls']) == str(local.get('non_exist1N9', 'ls'))

with pytest.raises(CommandNotFound):
local.get("non_exist1N9")
with pytest.raises(CommandNotFound):
Expand All @@ -270,10 +264,10 @@ def test_shadowed_by_dir(self):
fake_ls = local['ls']
del local.env.path[0]
assert fake_ls.executable == real_ls.executable







@skip_on_windows
def test_cwd(self):
Expand Down

0 comments on commit 1537460

Please sign in to comment.