From f491fe80b1bcd641b7b36708f5d11df2e319d114 Mon Sep 17 00:00:00 2001 From: Robert Smallshire Date: Thu, 7 May 2015 20:34:13 +0200 Subject: [PATCH] And here's the test with did the good work leading to the previous commit. --- test/test_catalog.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/test_catalog.py diff --git a/test/test_catalog.py b/test/test_catalog.py new file mode 100644 index 0000000..3d372ff --- /dev/null +++ b/test/test_catalog.py @@ -0,0 +1,18 @@ +import unittest + +from hypothesis import given, example +from hypothesis.specifiers import dictionary +from segpy.catalog import CatalogBuilder + + +class TestCatalogBuilder(unittest.TestCase): + + @given(dictionary(int, int)) + def test_constructor(self, mapping): + builder = CatalogBuilder(mapping) + catalog = builder.create() + shared_items = set(mapping.items()) & set(catalog.items()) + self.assertEqual(len(shared_items), len(mapping)) + + +