mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-09 22:36:14 +01:00
- added testcases for #658664 ("osc: a package internal error occured")
- a file was marked as 'A' but the file didn't exist in the wc: - if it's part of the commit abort - otherwise ignore it
This commit is contained in:
parent
306507748c
commit
70e43a87c2
1
tests/commit_fixtures/osctest/added_missing/.osc/_apiurl
Normal file
1
tests/commit_fixtures/osctest/added_missing/.osc/_apiurl
Normal file
@ -0,0 +1 @@
|
||||
http://localhost
|
3
tests/commit_fixtures/osctest/added_missing/.osc/_files
Normal file
3
tests/commit_fixtures/osctest/added_missing/.osc/_files
Normal file
@ -0,0 +1,3 @@
|
||||
<directory name="added_missing" rev="1" srcmd5="2df1eacfe03a3bec2112529e7f4dc39a" vrev="1">
|
||||
<entry md5="0d62ceea6020d75154078a20d8c9f9ba" mtime="1282047302" name="foo" size="23" skipped="True" />
|
||||
</directory>
|
@ -0,0 +1 @@
|
||||
1.0
|
@ -0,0 +1 @@
|
||||
added_missing
|
@ -0,0 +1 @@
|
||||
osctest
|
@ -0,0 +1,2 @@
|
||||
add
|
||||
bar
|
1
tests/commit_fixtures/osctest/added_missing/bar
Normal file
1
tests/commit_fixtures/osctest/added_missing/bar
Normal file
@ -0,0 +1 @@
|
||||
foobar
|
4
tests/commit_fixtures/testAddedMissing_cfilesremote
Normal file
4
tests/commit_fixtures/testAddedMissing_cfilesremote
Normal file
@ -0,0 +1,4 @@
|
||||
<directory name="added_missing" rev="2" srcmd5="2df1eacfe03a3bec2112529e7f4dc39a" vrev="2">
|
||||
<entry md5="14758f1afd44c09b7992073ccf00b43d" mtime="1292622742" name="bar" size="7" />
|
||||
<entry md5="0d62ceea6020d75154078a20d8c9f9ba" mtime="1282130148" name="foo" size="23" />
|
||||
</directory>
|
3
tests/commit_fixtures/testAddedMissing_filesremote
Normal file
3
tests/commit_fixtures/testAddedMissing_filesremote
Normal file
@ -0,0 +1,3 @@
|
||||
<directory name="added_missing" rev="1" srcmd5="2df1eacfe03a3bec2112529e7f4dc39a" vrev="1">
|
||||
<entry md5="0d62ceea6020d75154078a20d8c9f9ba" mtime="1282130148" name="foo" size="23" />
|
||||
</directory>
|
1
tests/commit_fixtures/testAddedMissing_lfilelist
Normal file
1
tests/commit_fixtures/testAddedMissing_lfilelist
Normal file
@ -0,0 +1 @@
|
||||
<directory><entry md5="14758f1afd44c09b7992073ccf00b43d" name="bar" /><entry md5="0d62ceea6020d75154078a20d8c9f9ba" name="foo" /></directory>
|
3
tests/commit_fixtures/testAddedMissing_missingfilelist
Normal file
3
tests/commit_fixtures/testAddedMissing_missingfilelist
Normal file
@ -0,0 +1,3 @@
|
||||
<directory error="missing" name="added_missing">
|
||||
<entry md5="14758f1afd44c09b7992073ccf00b43d" name="bar" />
|
||||
</directory>
|
@ -233,6 +233,34 @@ class TestCommit(OscTestCase):
|
||||
self._check_digests('testExpand_expandedfilesremote')
|
||||
self._check_status(p, 'simple', ' ')
|
||||
|
||||
@GET('http://localhost/source/osctest/added_missing?rev=latest', file='testAddedMissing_filesremote')
|
||||
def test_added_missing(self):
|
||||
"""commit an added file which is missing"""
|
||||
self._change_to_pkg('added_missing')
|
||||
p = osc.core.Package('.')
|
||||
ret = p.commit()
|
||||
self.assertTrue(ret == 1)
|
||||
exp = 'file \'add\' is marked as \'A\' but does not exist\n'
|
||||
self.assertEqual(sys.stdout.getvalue(), exp)
|
||||
self._check_status(p, 'add', '!')
|
||||
|
||||
@GET('http://localhost/source/osctest/added_missing?rev=latest', file='testAddedMissing_filesremote')
|
||||
@POST('http://localhost/source/osctest/added_missing?comment=&cmd=commitfilelist&user=Admin',
|
||||
file='testAddedMissing_missingfilelist', expfile='testAddedMissing_lfilelist')
|
||||
@PUT('http://localhost/source/osctest/added_missing/bar?rev=repository', exp='foobar\n', text=rev_dummy)
|
||||
@POST('http://localhost/source/osctest/added_missing?comment=&cmd=commitfilelist&user=Admin',
|
||||
file='testAddedMissing_cfilesremote', expfile='testAddedMissing_lfilelist')
|
||||
def test_added_missing2(self):
|
||||
"""commit an added file, another added file missing (but it's not part of the commit)"""
|
||||
self._change_to_pkg('added_missing')
|
||||
p = osc.core.Package('.')
|
||||
p.todo = ['bar']
|
||||
p.commit()
|
||||
exp = 'Sending bar\nTransmitting file data .\nCommitted revision 2.\n'
|
||||
self.assertEqual(sys.stdout.getvalue(), exp)
|
||||
self._check_status(p, 'add', '!')
|
||||
self._check_status(p, 'bar', ' ')
|
||||
|
||||
if __name__ == '__main__':
|
||||
import unittest
|
||||
unittest.main()
|
||||
|
Loading…
Reference in New Issue
Block a user