This repository has been archived by the owner on May 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from user-cont/release-bugfix
Bugfixes
- Loading branch information
Showing
6 changed files
with
42 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,4 @@ RUN chown -R 1001:0 ${HOME} | |
|
||
USER 1001 | ||
|
||
RUN git config --global user.email "[email protected]" && \ | ||
git config --global user.name "John Doe" | ||
|
||
CMD make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,7 @@ def fake_repository_clone_func(self, directory, name, non_ff=False): | |
def create_fake_repository(self, directory, non_ff=False): | ||
self.run_cmd("git init .", directory) | ||
self.run_cmd("git checkout -b master", directory) | ||
assert self.fedora.set_git_credentials(directory, "Name", "[email protected]") | ||
spec_content = Path(__file__).parent.joinpath("src/example.spec").read_text() | ||
Path(directory).joinpath("example.spec").write_text(spec_content) | ||
self.run_cmd("git add .", directory) | ||
|
@@ -93,6 +94,8 @@ def new_release(self): | |
'commitish': '', | ||
'author_name': 'John Doe', | ||
'author_email': '[email protected]', | ||
'commit_name': 'Testy McTestFace', | ||
'commit_email': '[email protected]', | ||
'python_versions': [3], | ||
'fedora_branches': ["f28"], | ||
'fedora': True, | ||
|
@@ -163,7 +166,7 @@ def package(self): | |
|
||
@pytest.fixture | ||
def non_existent_path(self, tmpdir): | ||
path = Path(str(tmpdir))/'fooo' | ||
path = Path(str(tmpdir)) / 'fooo' | ||
return str(path) | ||
|
||
@pytest.fixture | ||
|
@@ -177,8 +180,8 @@ def fake_repository(self, tmpdir): | |
|
||
@pytest.fixture | ||
def example_spec(self, tmpdir): | ||
spec_content = (Path(__file__).parent/"src/example.spec").read_text() | ||
spec = Path(str(tmpdir))/"example.spec" | ||
spec_content = (Path(__file__).parent / "src/example.spec").read_text() | ||
spec = Path(str(tmpdir)) / "example.spec" | ||
spec.write_text(spec_content) | ||
return str(spec) | ||
|
||
|
@@ -220,8 +223,8 @@ def test_wrong_dir_lint(self, non_existent_path): | |
|
||
def test_clone(self, tmp, package, fake_clone): | ||
directory = Path(self.fedora.fedpkg_clone_repository(tmp, package)) | ||
assert (directory/f"{package}.spec").is_file() | ||
assert (directory/".git").is_dir() | ||
assert (directory / f"{package}.spec").is_file() | ||
assert (directory / ".git").is_dir() | ||
|
||
def test_switch_branch(self, fake_repository): | ||
self.fedora.fedpkg_switch_branch(fake_repository, "f28", False) | ||
|
@@ -230,7 +233,7 @@ def test_switch_branch(self, fake_repository): | |
assert "master" == self.run_cmd("git rev-parse --abbrev-ref HEAD", fake_repository).stdout.strip() | ||
|
||
def test_commit(self, fake_repository): | ||
spec_path = fake_repository/"example.spec" | ||
spec_path = fake_repository / "example.spec" | ||
spec_content = spec_path.read_text() + "\n Test test" | ||
spec_path.write_text(spec_content) | ||
|
||
|
@@ -244,7 +247,7 @@ def test_lint(self, tmp, package, fake_clone): | |
directory = Path(self.fedora.fedpkg_clone_repository(tmp, package)) | ||
assert self.fedora.fedpkg_lint(str(directory), "master", False) | ||
|
||
spec_path = directory/f"{package}.spec" | ||
spec_path = directory / f"{package}.spec" | ||
with spec_path.open('r+') as spec_file: | ||
spec = spec_file.read() + "\n Test test" | ||
spec_file.write(spec) | ||
|
@@ -263,7 +266,7 @@ def test_spectool(self, tmp, package, fake_clone): | |
assert file_number != len(os.listdir(directory)) | ||
|
||
def test_workflow(self, fake_repository): | ||
spec_path = fake_repository/"example.spec" | ||
spec_path = fake_repository / "example.spec" | ||
spec_content = spec_path.read_text() + "\n Test test" | ||
spec_path.write_text(spec_content) | ||
|
||
|