Commit Graph

10 Commits

Author SHA1 Message Date
Darragh Bailey bb831cb4c4 Move commit creation code to GitTree class
Move all the code required to construct a git tree into the same class
and update references.

Change-Id: I5c0df30febcdd114c5e49c28adb7383897ecdd5c
2019-05-22 18:13:04 +01:00
Darragh Bailey 1ff58d6133 Split code for reuse and refactor for code style
To make it easier to reuse GitTree elsewhere move outside of the
gitfixture and reference.

Instead of treating the functions in utils as private to indicate they
shouldn't be relied upon outside of the package, switch utils to
indicate that it should not relied upon to clear up some IDE warnings
on use of private functions.

Finally avoid use of potentially mutable default params.

Change-Id: I3365a2c49ff570bd9e5eba5f53b4b3908dddd2b6
2019-05-22 18:13:04 +01:00
Darragh Bailey 6568d026cf Fixture for testing with clones of existing git repos
Add fixture to test with clones of repos from urls.

Change-Id: Ide13525f963495dc83b09ce98c7e9a685e89bf34
2019-05-22 15:55:44 +01:00
Darragh Bailey 2f95f62904 Fix arguments and add tests to autospec
Remove incorrect reference to 'self' after conversion to function from
object with method. Add some simple tests using autospecing to catch
passing the wrong number of arguments to the underlying github login
methods.

Change-Id: I8919997fca40a170fe47811a66db7964ba58a9d3
2018-12-18 16:13:49 +00:00
Darragh Bailey 701e2a1c36 Allow explicit control of repository name
If the user overrides the repo_name attributed, skip using the temporary
name generation.

Change-Id: Ia8c80ed139b5c5987886e2c7e00d63fd1d6aaf0f
2018-12-17 16:51:07 +00:00
Darragh Bailey 1593f2eb47 Drop Mixin class in favour of function
Change-Id: Id5622edb5d4209e81407786de5a9d7abe2b7b5e2
2018-12-13 16:19:07 +00:00
Darragh Bailey bd0d908b96 Fix temp name creation and cleanup
Allow the system to delete the file immediately as once the name is
generated there is no further need of the temp file.

Fix the temp name splitting and generation to handle being provided a
string without the 'XXXXXX' template as part of it.

Temporarily disable the requirements.txt check/gate as github3.py is
not part of global-requirements.

Change-Id: I14e56b0d4248dc037fab102acf3cb30573bfba8d
2018-12-13 16:18:48 +00:00
Darragh Bailey 45287200c5 Url parameter is only valid for enterprise login method
Call the appropriate login method using a simple mixin object.

Change-Id: I16029a64c21d811b2af56d55ce497a62fe9e9a1a
2018-12-07 13:09:14 +00:00
Darragh Bailey 8ece79aca2 Basic fixtures for testing with GitHub repos
Add simple fixtures for creating GitHub repos and forks.

Change-Id: I4ad30c26db60680166b88b434a521c4e885381e8
2018-07-10 10:01:02 +01:00
Darragh Bailey 248d079cc0 Initial fixture for git
Provide fixture object that can be used to build isolated test envs
when working with git and developing git tooling that uses the git
application.

Some basic tests on the topological sorting to ensure nodes are
returned in an expected order without requiring the code to enforce the
order.

Some simple acceptance tests ensure that the fixture will accept various
simple graphs and handle them correctly.

Change-Id: I5b39f8d52beca848adb20d646c26d91c4b977b92
2018-06-28 17:02:20 +01:00