def test_mkdir(self, mock_call): """Verify the commands to create directories.""" shell.mkdir('mock/dirpath') if os.name == 'nt': check_calls(mock_call, ["mkdir mock/dirpath"]) else: check_calls(mock_call, ["mkdir -p mock/dirpath"])
def it_should_fail_on_missing_repositories(config): shell.mkdir("deps") shell.rm(os.path.join("deps", "gitman_1")) with pytest.raises(InvalidRepository): gitman.lock() expect(config.__mapper__.text).does_not_contain("<unknown>")
def it_detects_invalid_repositories(config): shell.rm(os.path.join("deps", "gitman_1", ".git")) shell.mkdir(os.path.join("deps", "gitman_1", ".git")) try: with pytest.raises(InvalidRepository): expect(gitman.install('gitman_1', depth=1)) == False finally: shell.rm(os.path.join("deps", "gitman_1"))
def it_should_fail_on_invalid_repositories(config): shell.mkdir("deps") shell.rm(os.path.join("deps", "gitman_1", ".git")) shell.mkdir(os.path.join("deps", "gitman_1", ".git")) try: with pytest.raises(InvalidRepository): gitman.lock() expect(config.datafile.text).does_not_contain("<unknown>") finally: shell.rm(os.path.join("deps", "gitman_1"))
def test_mkdir(self, mock_call): """Verify the commands to create directories.""" shell.mkdir('mock/name/path') assert_calls(mock_call, ["mkdir -p mock/name/path"])