{"action":"created","comment":{"url":"https://api.github.com/repos/simphony/simphony-common/pulls/comments/34768394","id":34768394,"diff_hunk":"@@ -35,173 +39,186 @@ def create_dataset_items(self):\n         \"\"\"\n \n     @abc.abstractmethod\n-    def check_emtpy_dataset(self, ds):\n-        \"\"\" Check if a dataset is empty\n-        \"\"\"\n-\n-    @abc.abstractmethod\n     def check_instance_of_dataset(self, ds):\n         \"\"\" Check if a dataset is instance of a class\n         \"\"\"\n \n-    @abc.abstractmethod\n-    def check_is_usable_dataset(self, ds, items):\n-        \"\"\" Check if a dataset is usable\n-        \"\"\"\n+    operation_mapping = {\n+        'compare datasets': 'none',\n+        'add item': 'none'}\n+\n+    def compare_operation(self, *args, **kwrds):\n+        method = getattr(\n+            sys.modules[__name__],\n+            self.operation_mapping['compare datasets'])\n+        return method(*args, **kwrds)\n+\n+    def add_operation(self, container, *args, **kwrds):\n+        method = getattr(\n+            sys.modules[__name__],\n+            self.operation_mapping['add item'])\n+        return method(*args, **kwrds)\n \n     def test_get_missing_dataset(self):\n-        filename = os.path.join(self.temp_dir, 'test.cuds')\n-        with closing(H5CUDS.open(filename)) as handle:\n-            with self.assertRaises(ValueError):\n-                handle.get_dataset('foo')\n+        handle = self.engine_factory()\n+        with self.assertRaises(ValueError):\n+            handle.get_dataset('foo')\n \n     def test_add_dataset_empty(self):\n-        filename = os.path.join(self.temp_dir, 'test.cuds')\n-        with closing(H5CUDS.open(filename)) as handle:\n-            handle.add_dataset(self.create_dataset(name='test'))\n-            ds = handle.get_dataset(\"test\")\n+        handle = self.engine_factory()\n+        reference = self.create_dataset(name='test')\n+        handle.add_dataset(reference)\n+        ds = handle.get_dataset(\"test\")\n \n-            self.assertEqual(\"test\", ds.name)\n-            self.check_emtpy_dataset(ds)\n+        self.compare_operation(reference, ds, testcase=self)\n \n     def test_add_dataset_empty_data(self):\n-        filename = os.path.join(self.temp_dir, 'test.cuds')\n-        with closing(H5CUDS.open(filename)) as handle:\n-            handle.add_dataset(self.create_dataset(name='test'))\n-            pc = handle.get_dataset(\"test\")\n-            self.assertEqual(DataContainer(), pc.data)\n-            self.assertEqual(0, len(pc.data))\n+        handle = self.engine_factory()\n+        handle.add_dataset(self.create_dataset(name='test'))\n+        ds = handle.get_dataset(\"test\")\n+        self.assertEqual(DataContainer(), ds.data)\n+        self.assertEqual(0, len(ds.data))\n \n     def test_add_dataset_data_copy(self):\n-        filename = os.path.join(self.temp_dir, 'test.cuds')\n-        with closing(H5CUDS.open(filename)) as handle:\n-            handle.add_dataset(self.create_dataset(name='test'))\n-            pc = handle.get_dataset(\"test\")\n-            data = pc.data\n-            data[CUBA.NAME] = 'somename'\n-\n-            # Since the returned data is always a copy,\n-            #  therefore the pc.data should not have changed\n-            self.assertNotIn(CUBA.NAME, pc.data)\n-            # And the length should be still zero\n-            self.assertEqual(0, len(pc.data))\n-            pc.data = data\n-            # This time we replaced the pc.data,\n-            #  therefore it should have been changed\n-            self.assertIn(CUBA.NAME, pc.data)\n-            # The length also should have been changed\n-            self.assertEqual(1, len(pc.data))\n+        handle = self.engine_factory()\n+        handle.add_dataset(self.create_dataset(name='test'))\n+        ds = handle.get_dataset(\"test\")\n+        data = ds.data\n+        data[CUBA.NAME] = 'somename'\n+\n+        # Since the returned data is always a copy,\n+        #  therefore the ds.data should not have changed\n+        self.assertNotIn(CUBA.NAME, ds.data)\n+        # And the length should be still zero\n+        self.assertEqual(0, len(ds.data))\n+        ds.data = data\n+        # This time we replaced the ds.data,\n+        #  therefore it should have been changed\n+        self.assertIn(CUBA.NAME, ds.data)\n+        # The length also should have been changed\n+        self.assertEqual(1, len(ds.data))\n+\n+    def test_add_get_dataset(self):\n+        handle = self.engine_factory()\n+        reference = self.create_dataset(name='test')\n+\n+        # Store dataset container along with its data\n+        handle.add_dataset(reference)\n+        ds = handle.get_dataset('test')\n+\n+        self.compare_operation(reference, ds, testcase=self)\n \n     def test_add_get_dataset_data(self):\n-        filename = os.path.join(self.temp_dir, 'test.cuds')\n-        original_ds = self.create_dataset(name='test')\n+        handle = self.engine_factory()\n+\n+        reference = self.create_dataset(name='test')\n         # Change data\n-        data = original_ds.data\n+        data = reference.data\n         data[CUBA.NAME] = 'somename'\n-        original_ds.data = data\n+        reference.data = data\n \n-        # Store particle container along with its data\n-        with closing(H5CUDS.open(filename)) as handle:\n-            ds = handle.add_dataset(original_ds)\n+        # Store dataset container along with its data\n+        handle.add_dataset(reference)\n+        ds = handle.get_dataset('test')\n \n-        # Reopen the file and check the data if it is still there\n-        with closing(H5CUDS.open(filename, 'r')) as handle:\n-            ds = handle.get_dataset('test')\n-            self.assertIn(CUBA.NAME, ds.data)\n-            self.assertEqual(ds.data[CUBA.NAME], 'somename')\n+        self.compare_operation(reference, ds, testcase=self)\n \n     def test_add_dataset_with_same_name(self):\n-        filename = os.path.join(self.temp_dir, 'test.cuds')\n-        with closing(H5CUDS.open(filename)) as handle:\n-            handle.add_dataset(self.create_dataset(name='test'))\n-            with self.assertRaises(ValueError):\n-                handle.add_dataset(\n-                    self.create_dataset(name='test'))\n+        handle = self.engine_factory()\n+        handle.add_dataset(self.create_dataset(name='test'))\n+        with self.assertRaises(ValueError):\n+            handle.add_dataset(\n+                self.create_dataset(name='test'))\n \n     def test_iter_dataset(self):\n+        handle = self.engine_factory()\n         # add a few empty particle containers","path":"simphony/testing/abc_check_engine.py","position":198,"original_position":198,"commit_id":"df74973b87f077f717903effeb9989af38e0d919","original_commit_id":"df74973b87f077f717903effeb9989af38e0d919","user":{"login":"nathanfranklin","id":8287580,"avatar_url":"https://avatars.githubusercontent.com/u/8287580?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanfranklin","html_url":"https://github.com/nathanfranklin","followers_url":"https://api.github.com/users/nathanfranklin/followers","following_url":"https://api.github.com/users/nathanfranklin/following{/other_user}","gists_url":"https://api.github.com/users/nathanfranklin/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanfranklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanfranklin/subscriptions","organizations_url":"https://api.github.com/users/nathanfranklin/orgs","repos_url":"https://api.github.com/users/nathanfranklin/repos","events_url":"https://api.github.com/users/nathanfranklin/events{/privacy}","received_events_url":"https://api.github.com/users/nathanfranklin/received_events","type":"User","site_admin":false},"body":"this comment needs to be updated or removed","created_at":"2015-07-16T09:07:17Z","updated_at":"2015-07-16T09:07:17Z","html_url":"https://github.com/simphony/simphony-common/pull/189#discussion_r34768394","pull_request_url":"https://api.github.com/repos/simphony/simphony-common/pulls/189","_links":{"self":{"href":"https://api.github.com/repos/simphony/simphony-common/pulls/comments/34768394"},"html":{"href":"https://github.com/simphony/simphony-common/pull/189#discussion_r34768394"},"pull_request":{"href":"https://api.github.com/repos/simphony/simphony-common/pulls/189"}}},"pull_request":{"url":"https://api.github.com/repos/simphony/simphony-common/pulls/189","id":39936255,"html_url":"https://github.com/simphony/simphony-common/pull/189","diff_url":"https://github.com/simphony/simphony-common/pull/189.diff","patch_url":"https://github.com/simphony/simphony-common/pull/189.patch","issue_url":"https://api.github.com/repos/simphony/simphony-common/issues/189","number":189,"state":"open","locked":false,"title":"Simplify ABCEngine Cont.","user":{"login":"roigcarlo","id":1935791,"avatar_url":"https://avatars.githubusercontent.com/u/1935791?v=3","gravatar_id":"","url":"https://api.github.com/users/roigcarlo","html_url":"https://github.com/roigcarlo","followers_url":"https://api.github.com/users/roigcarlo/followers","following_url":"https://api.github.com/users/roigcarlo/following{/other_user}","gists_url":"https://api.github.com/users/roigcarlo/gists{/gist_id}","starred_url":"https://api.github.com/users/roigcarlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roigcarlo/subscriptions","organizations_url":"https://api.github.com/users/roigcarlo/orgs","repos_url":"https://api.github.com/users/roigcarlo/repos","events_url":"https://api.github.com/users/roigcarlo/events{/privacy}","received_events_url":"https://api.github.com/users/roigcarlo/received_events","type":"User","site_admin":false},"body":"This PR implements the rest of the #182 which was accidentaly merged.\r\n\r\nTODO:\r\n- [x] Extend Mesh and Particles compare tests with Bonds and Elements\r\n- [x] Create Compare test for Lattice ","created_at":"2015-07-14T16:44:52Z","updated_at":"2015-07-16T09:07:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71c3e9c98b2d88ddeb1394889ecf2f6adcc1da7e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/simphony/simphony-common/pulls/189/commits","review_comments_url":"https://api.github.com/repos/simphony/simphony-common/pulls/189/comments","review_comment_url":"https://api.github.com/repos/simphony/simphony-common/pulls/comments{/number}","comments_url":"https://api.github.com/repos/simphony/simphony-common/issues/189/comments","statuses_url":"https://api.github.com/repos/simphony/simphony-common/statuses/df74973b87f077f717903effeb9989af38e0d919","head":{"label":"simphony:fix-issue-159","ref":"fix-issue-159","sha":"df74973b87f077f717903effeb9989af38e0d919","user":{"login":"simphony","id":8048249,"avatar_url":"https://avatars.githubusercontent.com/u/8048249?v=3","gravatar_id":"","url":"https://api.github.com/users/simphony","html_url":"https://github.com/simphony","followers_url":"https://api.github.com/users/simphony/followers","following_url":"https://api.github.com/users/simphony/following{/other_user}","gists_url":"https://api.github.com/users/simphony/gists{/gist_id}","starred_url":"https://api.github.com/users/simphony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simphony/subscriptions","organizations_url":"https://api.github.com/users/simphony/orgs","repos_url":"https://api.github.com/users/simphony/repos","events_url":"https://api.github.com/users/simphony/events{/privacy}","received_events_url":"https://api.github.com/users/simphony/received_events","type":"Organization","site_admin":false},"repo":{"id":22651892,"name":"simphony-common","full_name":"simphony/simphony-common","owner":{"login":"simphony","id":8048249,"avatar_url":"https://avatars.githubusercontent.com/u/8048249?v=3","gravatar_id":"","url":"https://api.github.com/users/simphony","html_url":"https://github.com/simphony","followers_url":"https://api.github.com/users/simphony/followers","following_url":"https://api.github.com/users/simphony/following{/other_user}","gists_url":"https://api.github.com/users/simphony/gists{/gist_id}","starred_url":"https://api.github.com/users/simphony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simphony/subscriptions","organizations_url":"https://api.github.com/users/simphony/orgs","repos_url":"https://api.github.com/users/simphony/repos","events_url":"https://api.github.com/users/simphony/events{/privacy}","received_events_url":"https://api.github.com/users/simphony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simphony/simphony-common","description":"The native implementation of the Simphony cuds objects","fork":false,"url":"https://api.github.com/repos/simphony/simphony-common","forks_url":"https://api.github.com/repos/simphony/simphony-common/forks","keys_url":"https://api.github.com/repos/simphony/simphony-common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simphony/simphony-common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simphony/simphony-common/teams","hooks_url":"https://api.github.com/repos/simphony/simphony-common/hooks","issue_events_url":"https://api.github.com/repos/simphony/simphony-common/issues/events{/number}","events_url":"https://api.github.com/repos/simphony/simphony-common/events","assignees_url":"https://api.github.com/repos/simphony/simphony-common/assignees{/user}","branches_url":"https://api.github.com/repos/simphony/simphony-common/branches{/branch}","tags_url":"https://api.github.com/repos/simphony/simphony-common/tags","blobs_url":"https://api.github.com/repos/simphony/simphony-common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simphony/simphony-common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simphony/simphony-common/git/refs{/sha}","trees_url":"https://api.github.com/repos/simphony/simphony-common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simphony/simphony-common/statuses/{sha}","languages_url":"https://api.github.com/repos/simphony/simphony-common/languages","stargazers_url":"https://api.github.com/repos/simphony/simphony-common/stargazers","contributors_url":"https://api.github.com/repos/simphony/simphony-common/contributors","subscribers_url":"https://api.github.com/repos/simphony/simphony-common/subscribers","subscription_url":"https://api.github.com/repos/simphony/simphony-common/subscription","commits_url":"https://api.github.com/repos/simphony/simphony-common/commits{/sha}","git_commits_url":"https://api.github.com/repos/simphony/simphony-common/git/commits{/sha}","comments_url":"https://api.github.com/repos/simphony/simphony-common/comments{/number}","issue_comment_url":"https://api.github.com/repos/simphony/simphony-common/issues/comments{/number}","contents_url":"https://api.github.com/repos/simphony/simphony-common/contents/{+path}","compare_url":"https://api.github.com/repos/simphony/simphony-common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simphony/simphony-common/merges","archive_url":"https://api.github.com/repos/simphony/simphony-common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simphony/simphony-common/downloads","issues_url":"https://api.github.com/repos/simphony/simphony-common/issues{/number}","pulls_url":"https://api.github.com/repos/simphony/simphony-common/pulls{/number}","milestones_url":"https://api.github.com/repos/simphony/simphony-common/milestones{/number}","notifications_url":"https://api.github.com/repos/simphony/simphony-common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simphony/simphony-common/labels{/name}","releases_url":"https://api.github.com/repos/simphony/simphony-common/releases{/id}","created_at":"2014-08-05T17:05:12Z","updated_at":"2015-07-14T10:58:32Z","pushed_at":"2015-07-15T16:08:34Z","git_url":"git://github.com/simphony/simphony-common.git","ssh_url":"git@github.com:simphony/simphony-common.git","clone_url":"https://github.com/simphony/simphony-common.git","svn_url":"https://github.com/simphony/simphony-common","homepage":null,"size":6293,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":28,"forks":2,"open_issues":28,"watchers":6,"default_branch":"master"}},"base":{"label":"simphony:master","ref":"master","sha":"a575d99291bd1915d6457ceda71a47a4e76db872","user":{"login":"simphony","id":8048249,"avatar_url":"https://avatars.githubusercontent.com/u/8048249?v=3","gravatar_id":"","url":"https://api.github.com/users/simphony","html_url":"https://github.com/simphony","followers_url":"https://api.github.com/users/simphony/followers","following_url":"https://api.github.com/users/simphony/following{/other_user}","gists_url":"https://api.github.com/users/simphony/gists{/gist_id}","starred_url":"https://api.github.com/users/simphony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simphony/subscriptions","organizations_url":"https://api.github.com/users/simphony/orgs","repos_url":"https://api.github.com/users/simphony/repos","events_url":"https://api.github.com/users/simphony/events{/privacy}","received_events_url":"https://api.github.com/users/simphony/received_events","type":"Organization","site_admin":false},"repo":{"id":22651892,"name":"simphony-common","full_name":"simphony/simphony-common","owner":{"login":"simphony","id":8048249,"avatar_url":"https://avatars.githubusercontent.com/u/8048249?v=3","gravatar_id":"","url":"https://api.github.com/users/simphony","html_url":"https://github.com/simphony","followers_url":"https://api.github.com/users/simphony/followers","following_url":"https://api.github.com/users/simphony/following{/other_user}","gists_url":"https://api.github.com/users/simphony/gists{/gist_id}","starred_url":"https://api.github.com/users/simphony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simphony/subscriptions","organizations_url":"https://api.github.com/users/simphony/orgs","repos_url":"https://api.github.com/users/simphony/repos","events_url":"https://api.github.com/users/simphony/events{/privacy}","received_events_url":"https://api.github.com/users/simphony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simphony/simphony-common","description":"The native implementation of the Simphony cuds objects","fork":false,"url":"https://api.github.com/repos/simphony/simphony-common","forks_url":"https://api.github.com/repos/simphony/simphony-common/forks","keys_url":"https://api.github.com/repos/simphony/simphony-common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simphony/simphony-common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simphony/simphony-common/teams","hooks_url":"https://api.github.com/repos/simphony/simphony-common/hooks","issue_events_url":"https://api.github.com/repos/simphony/simphony-common/issues/events{/number}","events_url":"https://api.github.com/repos/simphony/simphony-common/events","assignees_url":"https://api.github.com/repos/simphony/simphony-common/assignees{/user}","branches_url":"https://api.github.com/repos/simphony/simphony-common/branches{/branch}","tags_url":"https://api.github.com/repos/simphony/simphony-common/tags","blobs_url":"https://api.github.com/repos/simphony/simphony-common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simphony/simphony-common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simphony/simphony-common/git/refs{/sha}","trees_url":"https://api.github.com/repos/simphony/simphony-common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simphony/simphony-common/statuses/{sha}","languages_url":"https://api.github.com/repos/simphony/simphony-common/languages","stargazers_url":"https://api.github.com/repos/simphony/simphony-common/stargazers","contributors_url":"https://api.github.com/repos/simphony/simphony-common/contributors","subscribers_url":"https://api.github.com/repos/simphony/simphony-common/subscribers","subscription_url":"https://api.github.com/repos/simphony/simphony-common/subscription","commits_url":"https://api.github.com/repos/simphony/simphony-common/commits{/sha}","git_commits_url":"https://api.github.com/repos/simphony/simphony-common/git/commits{/sha}","comments_url":"https://api.github.com/repos/simphony/simphony-common/comments{/number}","issue_comment_url":"https://api.github.com/repos/simphony/simphony-common/issues/comments{/number}","contents_url":"https://api.github.com/repos/simphony/simphony-common/contents/{+path}","compare_url":"https://api.github.com/repos/simphony/simphony-common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simphony/simphony-common/merges","archive_url":"https://api.github.com/repos/simphony/simphony-common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simphony/simphony-common/downloads","issues_url":"https://api.github.com/repos/simphony/simphony-common/issues{/number}","pulls_url":"https://api.github.com/repos/simphony/simphony-common/pulls{/number}","milestones_url":"https://api.github.com/repos/simphony/simphony-common/milestones{/number}","notifications_url":"https://api.github.com/repos/simphony/simphony-common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simphony/simphony-common/labels{/name}","releases_url":"https://api.github.com/repos/simphony/simphony-common/releases{/id}","created_at":"2014-08-05T17:05:12Z","updated_at":"2015-07-14T10:58:32Z","pushed_at":"2015-07-15T16:08:34Z","git_url":"git://github.com/simphony/simphony-common.git","ssh_url":"git@github.com:simphony/simphony-common.git","clone_url":"https://github.com/simphony/simphony-common.git","svn_url":"https://github.com/simphony/simphony-common","homepage":null,"size":6293,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":28,"forks":2,"open_issues":28,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/simphony/simphony-common/pulls/189"},"html":{"href":"https://github.com/simphony/simphony-common/pull/189"},"issue":{"href":"https://api.github.com/repos/simphony/simphony-common/issues/189"},"comments":{"href":"https://api.github.com/repos/simphony/simphony-common/issues/189/comments"},"review_comments":{"href":"https://api.github.com/repos/simphony/simphony-common/pulls/189/comments"},"review_comment":{"href":"https://api.github.com/repos/simphony/simphony-common/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/simphony/simphony-common/pulls/189/commits"},"statuses":{"href":"https://api.github.com/repos/simphony/simphony-common/statuses/df74973b87f077f717903effeb9989af38e0d919"}}}}