示例#1
0
 def test_nonexistent(self):
     with pytest.raises(PluginParamError):
         _load_from_path("./foo.bar")
示例#2
0
 def test_relative(self):
     assert _load_from_path("./test.txt") == "TEST"
示例#3
0
 def test_absolute(self, test_file):
     assert _load_from_path(os.path.abspath(test_file)) == "TEST"
示例#4
0
 def test_relative_fallback_to_cwd(self, tmpdir, base_dir):
     """File DOES NOT exists at given path relative to base_dir, but DOES
     exist relative to cwd"""
     assert _load_from_path("./test.txt", base_dir=base_dir) == "TEST"
示例#5
0
 def test_relative_exists(self, tmpdir, base_dir):
     """File exists at given path relative to base_dir"""
     assert _load_from_path("../test.txt", base_dir=base_dir) == "TEST"
示例#6
0
 def test_absolute(self, test_file, base_dir):
     """base_dir should be ignored if an absolute path is given"""
     assert (_load_from_path(os.path.abspath(test_file),
                             base_dir=base_dir) == "TEST")