Added tests for get_metadata

- Fixed Typo
This commit is contained in:
Joel Vasallo 2016-06-02 21:02:04 -05:00 committed by Mike McLean
parent d53b7c35a4
commit 8530353023
2 changed files with 14 additions and 1 deletions

View file

@ -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, '')