34 Commits

Author SHA1 Message Date
J. David Ibáñez
354d56a95c Update copyright years 2017-03-22 21:15:34 +01:00
Matthias Bartelmeß
cdd57b2c0f make sure the repo object will be collected before the repo is removed 2016-07-22 10:46:11 +02:00
J. David Ibáñez
70edbf256a Update copyright years 2015-10-11 18:48:59 +02:00
Guille -bisho-
802976535a Add support for GIT_DIFF_SHOW_BINARY
Adding the binary diff flag GIT_DIFF_SHOW_BINARY to pygit2.
libgit2 0.23.0 already supports this constant to be used in diff
flags and produces properly formated binary diffs.
2015-09-23 16:30:19 -07:00
Patrick Steinhardt
d35ecf945a Add tests for submodules. 2015-03-06 17:48:29 +01:00
J. David Ibáñez
d7071b88cd Update copyright year 2014-02-04 08:02:12 +01:00
Victor Garcia
1f5ec810ad implementing merge with default options 2013-12-04 18:17:10 +01:00
Fraser Tweedale
74b1628e51 test utils: implement a repo context manager
The current hierarchy of test cases that create and blow away test
repositories in the ``setUp`` and ``tearDown`` methods is inadequate
for testing scenarios where multiple repositories must be edited,
e.g.  testing push.

Extract the temporary repository behaviour into a context manager
class ``TemporaryRepository`` which can be used via the ``with``
keyword.  The context manager's ``__enter__` method returns creates
the specified repository in a temporary directory and returns its
path.  The temporary directory is removed in ``__exit__``.

Update the existing test case base classes to use the context
manager and invoke ``__enter__`` and ``__exit__`` in the ``setUp``
and ``tearDown`` methods respectively.

Finally, make some small tweaks to a handful of tests to get them
working under this new system.
2013-08-30 17:25:18 +10:00
J. David Ibáñez
f075aa3665 Fix some "errors" found by pyflakes 2013-05-24 21:34:10 +02:00
J. David Ibáñez
406c317572 Return Oid wherever we returned raw oid (bytes) before
Changes:

- Return Oid wherever we returned raw oid (bytes) before
- Now py_str_to_git_oid accepts Oid objects
- Add ability to compare two Oid objects
2013-04-14 12:26:22 +02:00
Nico von Geyso
2771c8a150 added assertAll and assertAny for test cases 2013-03-04 15:44:17 +01:00
J. David Ibáñez
29ce23c0d5 Update copyright 2013-03-02 12:16:16 +01:00
J. David Ibáñez
a96d494747 Coding style
Including:

- Lines longer than 79 chars
- Spaces at the end of line
- Wrong indentation
- Comma not followed by an space
- C++ style comments: //
2013-03-02 11:40:42 +01:00
Nico von Geyso
bc2bb9fc26 added assertRaisesAssign test function 2013-02-16 19:47:31 +01:00
Nico von Geyso
1bbb7b549f Added empty test repository 2012-11-01 16:17:29 +01:00
J. David Ibáñez
edcd803e7e Remove the __authors__ var from py files 2012-07-18 12:12:04 +02:00
J. David Ibáñez
6195491596 Add/update copyright header of each file
And update my email address.
2012-07-18 12:07:17 +02:00
Nico von Geyso
c04ba3ac2b python3 compatibility
fixed unicode/byte string issues for python3
2012-05-15 11:24:03 +02:00
Nico von Geyso
632750565b added tests for Repository.create_blob() 2012-05-11 14:03:35 +02:00
Yonggang Luo
a444cd1e1c utils.py Use onerror deal with rmtree 2012-03-14 22:59:16 +01:00
J. David Ibáñez
e9e902e024 tests: add utility function 'oid_to_hex' 2012-02-27 00:12:33 +01:00
J. David Ibáñez
9064b8e038 Introduce the Signature object 2011-11-23 23:48:41 +01:00
J. David Ibáñez
af983b989a tests: fixing issue #20
There were two problems:

- Windows refuses to remove a file that is in use. Solution, close
  the repo before cleaning the temporary directory.

- Windows refuses to remove a read-only file. Solution, change mode
  to writable.
2011-10-17 20:44:54 +02:00
J. David Ibáñez
f09a02a2ee Use UTF-8 encoding in all Python files 2011-08-24 07:42:05 +02:00
J. David Ibáñez
7950ee1116 Use Python 3 string literals for the unit tests
Now unit tests are broken.
2011-08-13 22:48:23 +02:00
J. David Ibáñez
aaa3d533a8 Drop support for Python 2.5
It still compiles and probably works fine. But unit tests do not run and
official support for Python 2.5 has been dropped.
2011-08-13 22:05:43 +02:00
J. David Ibáñez
7b8ae0e10c Python 3, now pygit2 builds
Tests do not yet pass.
2011-08-10 22:52:42 +02:00
Petr Viktorin
bfd20dc4b4 Somewhat better test coverage
- create_repository
- IndexEntry.path
- Correct SHAs in Index iteration
- Opening a bare index & attempting to add to it
- Walker.reset
- Walker.push
- Walker.sort
2011-08-08 23:42:01 +02:00
Julien Miotte
d313af21a0 Adding a DirtyRepoTestCase to be able to test Repository.status().
Also, adding a dirty repository in the data directory.
2011-07-27 18:39:12 +02:00
J. David Ibañez
83a78dac5f Fix unit tests for Python 2.5 2011-02-09 16:30:15 +01:00
J. David Ibañez
f643037b79 Add unit tests for the index file 2011-02-08 18:22:09 +01:00
J. David Ibañez
fe1540f546 Add index test case for a non-bare repo 2011-02-07 13:28:39 +01:00
Dave Borowitz
520556e552 Add assertRaisesWithArg for better KeyError/IndexError testing.
Change-Id: Iadc9075e8e705579e4c0daf49fe7110db55e87c0
2010-11-12 13:28:48 -08:00
Dave Borowitz
a2b0f45368 Add simple repository tests.
Change-Id: I128ac826f1c673002bc6f17696691e5a4bd7f0fd
2010-11-12 13:19:57 -08:00