summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2013-04-13Add minimal vfs interfaceGuido Günther
so we can access blobs in git as file like objects
2013-04-08tests: Use tempfile.mkdtemp to create temp dirs for testsThomas Koch
This puts test dirs below /tmp which often is a tmpfs. All tests include the context module which consolidates tmpdir creation and cleanup, undoes a chdir in teardown and silences log messages.
2013-04-06Add urgency management.Daniel Dehennin
* tests/11_test_dch_main.py: test the new --urgency option to dch.main(). Add only meaningful tests, i.e. options alone and combined with --release and --snapshot. * git-dch (fixup_section): Manage "urgency" option. (main): Add version_group option "-U" and "--urgency" to set the urgency level of the entry. * docs/manpages/git-dch.sgml: Update documentation for new option.
2013-04-06Add option to manage distribution fields for non snapshot mode.Daniel Dehennin
The snapshot mode fails to merge two "debian/changelog" entries if the distribution is not "UNRELEASED". * tests/11_test_dch_main.py: test the new --distribution option to dch.main(). Add only meaningful tests, i.e. options alone and combined with --release and --snapshot. * git-dch (fixup_section): Rename as it's used to fix header in addition to trailer, this require a new named parameter "options". (main): Add version_group option "-D" and "--distribution" to specify the distribution name. Add version_group option "--force-distribution" to force the provided distribution to be used, used by "dch". Rename fixup_trailer() to fixup_section() and add options as parameters. * docs/manpages/git-dch.sgml: Update documentation for new options. Closes: #646684
2013-03-29Move debian/changelog manipulation to gbp.deb.changelog.ChangeLog.Daniel Dehennin
spawn_dch switch gbp.command.wrappers.Command. * gbp/deb/changelog.py (ChangeLog.spawn_dch): static method adapted from gbp.scripts.dch and converted to gbp.command_wrappers.Command. (add_entry): New method adapted from gbp.scripts.dch.add_changelog_entry. (add_section): New method adapted from gbp.scripts.dch.add_changelog_entry. Remove DebianGitRepository and options, this has nothing to do with changelog management. * tests/test_Changelog.py: Test new methods. * gbp/scripts/dch.py: Remove useless functions: system(), spawn_dch(), add_changelog_section() and add_changelog_entry(). Update calls accordingly. (fixup_trailer): Use spawn_dch() method of ChangeLog class. (process_options): dch_options became a list. (main): Use add_section() and add_entry() methods of ChangeLog object. Take care of upstream version since ChangeLog.add_section() does not manage it anymore. Update exception handling, ChangeLog.spawn_dch() can raise "CommandExecFailed" exception. Closes: #672954
2013-03-27tests.test_GitRepository: import and setup gbp.logMarkus Lehtonen
In order to initialize gbp logging properly. Fixes false positives when the GitRepository tests are run alone. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-03-27Split out building a debian version from an upstream commitGuido Günther
based on a patch by Daniel Dehennin Needed for #672954, #646684, #669171
2013-03-22ComponentTestBase: capability to check files of repoMarkus Lehtonen
Makes it possible to check that the correct files are present in the working copy of the repo. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-03-22GitRepository/_cmd_has_feature: more intelligent parsingMarkus Lehtonen
More intelligent parsing of the git output (man page). Try to parse optional options like '--[no-]standard-notes' of git-show correctly. In this example both 'no-standard-notes' and 'standard-notes' would be available. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-03-22tests: skip test_Changelog if 'dch' tool is not availableMarkus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-03-22tests/component: pylint fixesMarkus Lehtonen
Add module docstring and wrap one overlong line. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-03-22ComponentTestBase: close streamhandler when stopping log captureMarkus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Guido Günther <agx@sigxcpu.org>
2013-01-16Move over import dsc test from external test suiteGuido Günther
Move over the first test from our external (shell based) test suite to the component tests.
2013-01-16Add test data submoduleGuido Günther
2013-01-16Add component test initializationGuido Günther
very heavily based on code by Markus Lehtonen
2013-01-16tests.testutils: baseclass for testing commandline toolsMarkus Lehtonen
Introduce a new baseclass to be utilized in testing the git-buildpackage command line tools. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-01-16pq: do author guessing outside the apply_patch functionsMarkus Lehtonen
Call the author parsing/guessing function outside the apply patch functions. This way, the caller can decide when to do the guessing, and with which parameters. Now the apply_patch functions do what their name suggests. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-24git-import-dscs: Properly catch import errorsGuido Günther
Closes: #694113
2012-11-24Test gbp.pq.common.write_patchGuido Günther
2012-11-23GitRepository/get_submodules: use correct pathMarkus Lehtonen
By default, run git in the repo path, not current cwd. Also, now returns submodule paths without leading './'. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-23GitRepository/get_commits: more flexible revision rangesMarkus Lehtonen
Support getting the complete history of an arbitrary commit-ish (since=None, until=COMMIT-ISH). Formerly this was only possible for the current git HEAD. Now, get_commits(since=None, until='COMMIT') translates to 'git log COMMIT'. Also, for consistency, add support for getting the history from an arbitrary commit until the current HEAD (since=COMMIT-ISH, until=None). Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-23Test if setting a topic worksGuido Günther
2012-11-23pq: Allow to pass in custom fucntion to fetch authorship informationGuido Günther
so the RPM based tools don't need to rely on a control file but can e.g. look at the spec file.
2012-11-23Test apply_and_commit_patchGuido Günther
2012-11-23testutils: create missing directories when adding a fileGuido Günther
2012-11-23tests: make tests a Python moduleMarkus Lehtonen
Makes it possible to reuse code between various tests. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-07GitRepository/diff: add 'paths' argumentMarkus Lehtonen
Makes the diff function more versatile. I.e. makes diffing only certain paths possible. Also, add basic unittests for the diff() method. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-07GitRepository.find_tag: change deprecated _git_getoutput to _git_inoutEd Bartosh
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-07GitRepository: implement _cmd_has_feature() methodMarkus Lehtonen
This method is intended for checking if the local git (client) command supports a certain feature. The "feature" is considered to be a command line option. E.g. does "merge" command have the "edit" feature translates to does git-merge support the '--edit' command line option. To figure this out, _cmd_has_feature() parses through the "OPTIONS" section of the man page of the git command. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-10-25PEP-8 and pyflakes cleanupsGuido Günther
2012-08-22GitRepository: Implement set_upstream_branch and get_upstream_branch methodsEd Bartosh
set_upstream_branch sets upstream branch for the local branch using git branch --set-upstream get_upstream_branch returns info about upstream branches Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2012-08-02Add tests for gbp.deb.{DpkgCompareVersions,DscFile}Guido Günther
2012-08-01Test help output by importing the modulesGuido Günther
so we get correct coverage information for the scripts
2012-08-01Skip tests requiring devscripts if dch is not thereGuido Günther
so tests don't fail on rpm based systems.
2012-07-31Test behavior of gbp.scripts.dch.main().Daniel Dehennin
* tests/11_test_dch_main.py: Test common cases with "--release" and "--snapshot". Try 2 consecutive snapshots to check for merged entries.
2012-07-29GitModifier: add tests for dict interfaceGuido Günther
2012-07-27GitRepository/get_commit_info: add file statusMarkus Lehtonen
Add file status and name to the info returned by the get_commit_info() method. Signed-off-by: Zhang Qiang <qiang.z.zhang@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-27GitRepository/get_commit_info: add committer infoMarkus Lehtonen
Add committer to the info returned by get_commit_info() method. Returns committer name, email and timestamp as a GitModifier object. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-27GitRepository/get_commit_info: add author timestampMarkus Lehtonen
Add author timestamps to the info returned by get_commit_info() method. Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-27GitModifier: More flexible date handlingGuido Günther
Allow to pass in the date as datetime object, timestamp or git raw date. and allow to retrieve these values. This make constructing GitModifiers from python simpler.
2012-07-24GitRepository: option to ignore untracked in is_clean()Markus Lehtonen
Add an option to ignore untracked files when checking if the repository is clean. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-23gbp.git.GitRepository: Add remove_remoteGuido Günther
2012-07-03GitRepository: Make rev_parse's short option an int everywhereGuido Günther
2012-06-30GitRepository: Add test that covers remote branches in has_branch()Guido Günther
2012-06-30GitRepository: return GitModifier object instead of separate fieldsGuido Günther
this make sure the number of return values doesn't stays sane when also returning timestamps and committer information.
2012-06-30GitRepository: make get_commit_info() more robustMarkus Lehtonen
Now uses git-show instead of git-log. This is needed for further enhancements (namely to get name-status for merge commits). Also, use null-character as the field separator which makes parsing more reliable. The method now returns 'body' of the commit message as is, without stripping or splitting to lines. In addition, get_commit_info() now uses GitArgs and _git_inout() instead of the deprecated _git_getoutput(). Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-06-30tests: test GitRepository.get_commit_info()Guido Günther
2012-06-30PristineTar: move Debian-specific stuff to DebianPristineTarMarkus Lehtonen
Continuation to the PristineTar refactoring, makes the "common" PristineTar independent of DebianPkgPolicy. This commit moves the Debian-specific has_commit() and checkout() methods to DebianPristineTar class and replaces them with more generic functions in the base class. Also, drops the Debian-specific get_commit() method completely, as it was not used outside the PristineTar class itself. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-06-25UpstreamSource: automatically detect package name and versions from directoriesGuido Günther
of the form packagename-<version>
2012-06-25Make TestDir testcase use a newly created directoryGuido Günther
neeeded for the upcoming packagename/version parsing support