INCOMPLETE_MAPPING_FILE = 'test/data/incomplete.http.mapping'


class TestMapReader(unittest.TestCase):

    def test_get_tx_names_incomplete_mapping_file(self):
        map_reader = MapReader()
with self.assertRaises(SystemExit) as cm:
    tx_names = map_reader.get_tx_names(INCOMPLETE_MAPPING_FILE)
self.assertEqual(cm.exception.code, 1)
Is it possible for a unit test to assert that a method calls sys.exit()