Skip to content

Commit

Permalink
Add test for st_nlink on win
Browse files Browse the repository at this point in the history
  • Loading branch information
soapy1 committed Dec 15, 2016
1 parent e67d419 commit 399a385
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
from os import link
from os.path import join

import pytest
from conda_build.utils import on_win
import conda_build._link as _link
from conda_build.conda_interface import PathType, EntityEncoder, CrossPlatformStLink


class TestLink(unittest.TestCase):

def test_pyc_f_2(self):
Expand Down Expand Up @@ -43,6 +46,7 @@ def test_entity_encoder(tmpdir):
assert json_file == {"a": "hardlink", "b": 1}


@pytest.skipif(on_win, reason="link not available on win/py2.7")
def test_crossplatform_st_link(tmpdir):
test_file = join(str(tmpdir), "test-file")
test_file_linked = join(str(tmpdir), "test-file-linked")
Expand All @@ -55,3 +59,9 @@ def test_crossplatform_st_link(tmpdir):
assert 2 == CrossPlatformStLink.st_nlink(test_file_link)
assert 2 == CrossPlatformStLink.st_nlink(test_file_linked)


def test_crossplatform_st_link_on_win(tmpdir):
test_file = join(str(tmpdir), "test-file")
open(test_file, "a").close()
assert 1 == CrossPlatformStLink.st_nlink(test_file)

0 comments on commit 399a385

Please sign in to comment.