summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2013-06-18Add wrapper for all gbp commandsGuido Günther1-0/+29
So like git you can now use gbp <command> instead of git-<command> or gbp-<command>. The manpages and docs aren't adjusted yet.
2013-06-11GitRepository.get_subject: use get_commit_infoGuido Günther1-0/+2
This kills another _git_getoutput. Also deprecate the method since we don't need to special case the subject.
2013-06-11buildpackage: use get_commit_info() instead of get_subject()Markus Lehtonen1-2/+2
Utilize the get_commit_info() method of GitRepository instead of the deprecated get_subject(). Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-06-11Remove unused importsGuido Günther1-3/+0
2013-06-06GitRepository/get_commit_info: add patchname to infoMarkus Lehtonen1-0/+2
Add a new 'patchname' field to the information returned by get_commit_info. That is, the subject in a sanitized format, similar to what git-format-patch uses. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-06-06gitmodifier: make the datetime object always have timezoneMarkus Lehtonen1-4/+4
To be consistent with the date property and for easier compatibility with git dates. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-30trivial: simplify option assignmentGuido Günther1-19/+10
to ease readability
2013-04-30Silence test_debian_missing_authorGuido Günther1-1/+7
and better use the output for verification
2013-04-29Make parse_dsc a classmethod of DscFileGuido Günther2-9/+11
so we have the object creation close to the object itself.
2013-04-29ChangeLog: Remove is_nativeGuido Günther1-9/+0
to avoid accidental usage. Use DebianSource.is_native instead.
2013-04-27GitRepository.has_feature: capture stderrGuido Günther1-1/+1
to avoid spurious output on the console and add the error message to the exception intead.
2013-04-27Silence GitRepository.grep_logGuido Günther1-2/+2
None of the gbp script rely on the output being printed. In fact we improve the exception by appending the stderr output.
2013-04-2610_test_get_upstream_tree: Fix test descriptionsGuido Günther1-6/+6
2013-04-2614_test_gbp_import_dscs: Mock gbp.log.errGuido Günther1-2/+9
to get rid of the spurious error message
2013-04-26tests: Fix tests for UbuntuMarkus Lehtonen3-20/+71
On Ubuntu dch produces different version numbering. Adapt tests for this. Adds a jew class to parse '/etc/lsb-release' to determine the distribution and it's codename to dynamically adapt tests accordingly. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-26tests: add missing import in test_ChangelogMarkus Lehtonen1-0/+1
That was erroneously removed in 3d6b68ae541d6020ff747628b3e44196999e0a50. and breaks without dch installed Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-25GitRepository: add describe() methodMarkus Lehtonen1-1/+28
Provides more output options than find_tag(). - longfmt: for getting the tag name in the long format (tag, number of commits and sha1) - always: for falling back to sha1 if no (matching) tag name is found - abbrev: for defining the length of sha1 returned Change GitRepository.find_tag() to use the the new method. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-25tests: another fix for older dchMarkus Lehtonen1-4/+4
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-25tests: fix for older dchMarkus Lehtonen1-2/+2
Prevent dch from asking user input during tests. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-13Honor debian/source/formatGuido Günther1-1/+2
when checking if a package is a native package Closes: #669267
2013-04-13Introduce Source classGuido Günther5-9/+91
so we don't have to expose all the details of Debian's different files and conventions.
2013-04-13Add minimal vfs interfaceGuido Günther1-0/+55
so we can access blobs in git as file like objects
2013-04-08tests: Use tempfile.mkdtemp to create temp dirs for testsThomas Koch22-120/+180
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 Dehennin1-0/+29
* 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 Dehennin1-98/+154
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 Dehennin1-0/+85
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 Lehtonen1-0/+4
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ünther1-20/+25
based on a patch by Daniel Dehennin Needed for #672954, #646684, #669171
2013-03-22ComponentTestBase: capability to check files of repoMarkus Lehtonen1-1/+18
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 Lehtonen1-0/+4
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 Lehtonen1-0/+7
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-03-22tests/component: pylint fixesMarkus Lehtonen1-2/+5
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 Lehtonen1-0/+1
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ünther1-0/+52
Move over the first test from our external (shell based) test suite to the component tests.
2013-01-16Add test data submoduleGuido Günther1-0/+0
2013-01-16Add component test initializationGuido Günther3-86/+187
very heavily based on code by Markus Lehtonen
2013-01-16tests.testutils: baseclass for testing commandline toolsMarkus Lehtonen1-0/+85
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 Lehtonen1-2/+2
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ünther1-0/+87
Closes: #694113
2012-11-24Test gbp.pq.common.write_patchGuido Günther2-18/+61
2012-11-23GitRepository/get_submodules: use correct pathMarkus Lehtonen1-1/+1
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 Lehtonen1-0/+10
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ünther1-0/+10
2012-11-23pq: Allow to pass in custom fucntion to fetch authorship informationGuido Günther1-5/+26
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ünther2-0/+69
2012-11-23testutils: create missing directories when adding a fileGuido Günther1-1/+5
2012-11-23tests: make tests a Python moduleMarkus Lehtonen5-4/+24
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 Lehtonen1-0/+17
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 Bartosh1-1/+1
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 Lehtonen1-0/+25
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>