Added tests for get_metadata
- Fixed Typo
This commit is contained in:
parent
d53b7c35a4
commit
8530353023
2 changed files with 14 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ import unittest
|
|||
import mock
|
||||
|
||||
import kojihub
|
||||
from koji import GenericError
|
||||
|
||||
|
||||
class TestCGImporter(unittest.TestCase):
|
||||
|
|
@ -9,3 +10,15 @@ class TestCGImporter(unittest.TestCase):
|
|||
# TODO -- this doesn't make sense. A query with no arguments should
|
||||
# probably raise an exception saying "this doesn't make sense."
|
||||
kojihub.CG_Importer() # No exception!
|
||||
|
||||
def test_get_metadata_is_instance(self):
|
||||
mock_input_val = {'something': 'good val'}
|
||||
x = kojihub.CG_Importer()
|
||||
x.get_metadata(mock_input_val, '')
|
||||
assert x.raw_metadata
|
||||
assert isinstance(x.raw_metadata, str)
|
||||
|
||||
def test_get_metadata_is_not_instance(self):
|
||||
x = kojihub.CG_Importer()
|
||||
with self.assertRaises(GenericError):
|
||||
x.get_metadata(42, '')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue