mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-19 00:17:51 +02:00
add apt-get-sqq parser tests
This commit is contained in:
1
tests/fixtures/generic/apt_get_sqq--sample.json
vendored
Normal file
1
tests/fixtures/generic/apt_get_sqq--sample.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"operation":"unpack","package":"dpkg","broken":"1.19.7","proposed_pkg_ver":"1.19.8 Debian:10.13/oldstable","existing_src":"Debian-Security:10/oldstable","architecture":"amd64"},{"operation":"unpack","package":"dpkg","broken":null,"proposed_pkg_ver":"1.19.8 Debian:10.13/oldstable","existing_src":"Debian-Security:10/oldstable","architecture":"amd64"},{"operation":"configure","package":"dpkg","broken":"1.19.7","proposed_pkg_ver":"1.19.8 Debian:10.13/oldstable","existing_src":"Debian-Security:10/oldstable","architecture":"amd64"},{"operation":"remove","package":"dpkg","broken":"1.19.7","proposed_pkg_ver":"1.19.8 Debian:10.13/oldstable","existing_src":"Debian-Security:10/oldstable","architecture":"amd64"},{"operation":"unpack","package":"base-files","broken":"10.3+deb10u4","proposed_pkg_ver":"10.3+deb10u13 Debian:10.13/oldstable","existing_src":null,"architecture":"amd64"},{"operation":"configure","package":"base-files","broken":null,"proposed_pkg_ver":"10.3+deb10u13 Debian:10.13/oldstable","existing_src":null,"architecture":"amd64"},{"operation":"unpack","package":"dpkg","broken":"1.19.7","proposed_pkg_ver":"1.19.8 Debian:10.13/oldstable","existing_src":"Debian-Security:10/oldstable","architecture":"amd64"},{"operation":"configure","package":"dpkg","broken":null,"proposed_pkg_ver":"1.19.8 Debian:10.13/oldstable","existing_src":"Debian-Security:10/oldstable","architecture":"amd64"}]
|
9
tests/fixtures/generic/apt_get_sqq--sample.out
vendored
Normal file
9
tests/fixtures/generic/apt_get_sqq--sample.out
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
Inst dpkg [1.19.7] (1.19.8 Debian:10.13/oldstable, Debian-Security:10/oldstable [amd64])
|
||||
Inst dpkg (1.19.8 Debian:10.13/oldstable, Debian-Security:10/oldstable [amd64])
|
||||
Conf dpkg [1.19.7] (1.19.8 Debian:10.13/oldstable, Debian-Security:10/oldstable [amd64])
|
||||
Remv dpkg [1.19.7] (1.19.8 Debian:10.13/oldstable, Debian-Security:10/oldstable [amd64])
|
||||
|
||||
Inst base-files [10.3+deb10u4] (10.3+deb10u13 Debian:10.13/oldstable [amd64])
|
||||
Conf base-files (10.3+deb10u13 Debian:10.13/oldstable [amd64])
|
||||
Inst dpkg [1.19.7] (1.19.8 Debian:10.13/oldstable, Debian-Security:10/oldstable [amd64])
|
||||
Conf dpkg (1.19.8 Debian:10.13/oldstable, Debian-Security:10/oldstable [amd64])
|
28
tests/test_apt_get_sqq.py
Normal file
28
tests/test_apt_get_sqq.py
Normal file
@ -0,0 +1,28 @@
|
||||
import unittest
|
||||
|
||||
from tests import utils_for_test as test_utils
|
||||
|
||||
# Execute these steps for standard tests:
|
||||
# - Save this file as `test_{parser_name}.py` since the helper methods extract parser names from the filename.
|
||||
# - Organize fixtures in `tests/fixtures` for optimal structure.
|
||||
# - Format fixtures as follows (using double dashes):
|
||||
# - `{parser_name}--{some_test_description}.out` for command output.
|
||||
# - `{parser_name}--{some_test_description}.json` for expected JSON after parsing.
|
||||
|
||||
class MyTests(unittest.TestCase):
|
||||
|
||||
def test_apt_get_sqq_nodata(self):
|
||||
"""
|
||||
Test 'apt-get -sqq' with no data
|
||||
"""
|
||||
test_utils.run_no_data(self, __file__, [])
|
||||
|
||||
def test_apt_get_sqq_all_fixtures(self):
|
||||
"""
|
||||
Test 'apt-get -sqq' with various fixtures
|
||||
"""
|
||||
test_utils.run_all_fixtures(self, __file__)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Reference in New Issue
Block a user