{"action":"created","comment":{"url":"https://api.github.com/repos/dionyziz/rupture/pulls/comments/73238271","id":73238271,"diff_hunk":"@@ -33,11 +34,72 @@ def test_first_round(self, Sniffer):\n     def test_same_round_same_batch(self):\n         pass\n \n-    def test_same_round_different_batch(self):\n-        pass\n+    @patch('breach.strategy.Sniffer')\n+    def test_same_round_different_batch(self, Sniffer):\n+        \n+        # Mock captured parameteres for Sniffer\n+        capture0 = {'data': 'exlength', 'records': 1}\n+        capture1 = {'data': 'length', 'records': 1}\n+        instance = Sniffer.return_value\n+        instance.read.return_value = capture0\n \n-    def test_advance_round(self):\n-        pass\n+        strategy0 = Strategy(self.dif_batch_victim)\n+        work0 = strategy0.get_work()\n+        self.assertTrue(work0)\n+        self.assertFalse(strategy0.work_completed())\n+\n+\n+        instance.read.return_value = capture1\n+        strategy1 = Strategy(self.dif_batch_victim)\n+        work1 = strategy1.get_work()\n+        self.assertTrue(work1)\n+        self.assertFalse(strategy1.work_completed())\n+\n+        samplesets_to_check = SampleSet.objects.filter(\n+            round=strategy1._round\n+        )\n+        \n+        # Test if the sampleset's new batch is the same with the old one\n+        self.assertEqual(samplesets_to_check[0].round, samplesets_to_check[2].round)  \n+        self.assertEqual(samplesets_to_check[0].candidatealphabet, samplesets_to_check[2].candidatealphabet)  \n+        self.assertEqual(samplesets_to_check[0].alignmentalphabet, samplesets_to_check[2].alignmentalphabet)  \n+        self.assertNotEqual(samplesets_to_check[0].batch, samplesets_to_check[2].batch)  \n+\n+    @patch('breach.strategy.Sniffer')\n+    def test_advance_round(self, Sniffer):\n+        # Mock captured parameteres for Sniffer\n+        capture0 = {'data': 'bigbignextround', 'records': 1}\n+        capture1 = {'data': 'smallround', 'records': 1}\n+        instance = Sniffer.return_value\n+        instance.read.return_value = capture0\n+\n+        strategy0 = Strategy(self.next_round_victim)\n+        work0 = strategy0.get_work()\n+        self.assertTrue(work0)\n+        self.assertFalse(strategy0.work_completed())\n+\n+\n+        instance.read.return_value = capture1\n+        strategy1 = Strategy(self.next_round_victim)\n+        work1 = strategy1.get_work()\n+        self.assertTrue(work1)\n+        self.assertFalse(strategy1.work_completed())\n+\n+        # Check if new samplesets have been created for the next round\n+        next_round_samplesets = list()\n+        samplesets_to_check = SampleSet.objects.filter()\n+\n+        for sample in samplesets_to_check:\n+            if (sample.round.index==2):           \n+                next_round_samplesets.append(sample)\n+    \n+        alphabet = '0123456789'\n+        index = 0\n+\n+        for sampleset in next_round_samplesets:\n+            self.assertEqual(sampleset.round.knownsecret, 'testsecret1')\n+            self.assertEqual(sampleset.candidatealphabet, alphabet[index])\n+            index +=1","path":"backend/breach/tests/test_strategy.py","position":81,"original_position":81,"commit_id":"984c27888daf8f144a5fe62ac4c4c240f297d7d1","original_commit_id":"984c27888daf8f144a5fe62ac4c4c240f297d7d1","user":{"login":"dionyziz","id":544572,"avatar_url":"https://avatars.githubusercontent.com/u/544572?v=3","gravatar_id":"","url":"https://api.github.com/users/dionyziz","html_url":"https://github.com/dionyziz","followers_url":"https://api.github.com/users/dionyziz/followers","following_url":"https://api.github.com/users/dionyziz/following{/other_user}","gists_url":"https://api.github.com/users/dionyziz/gists{/gist_id}","starred_url":"https://api.github.com/users/dionyziz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dionyziz/subscriptions","organizations_url":"https://api.github.com/users/dionyziz/orgs","repos_url":"https://api.github.com/users/dionyziz/repos","events_url":"https://api.github.com/users/dionyziz/events{/privacy}","received_events_url":"https://api.github.com/users/dionyziz/received_events","type":"User","site_admin":false},"body":"style","created_at":"2016-08-02T21:10:14Z","updated_at":"2016-08-02T21:10:14Z","html_url":"https://github.com/dionyziz/rupture/pull/186#discussion_r73238271","pull_request_url":"https://api.github.com/repos/dionyziz/rupture/pulls/186","_links":{"self":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/comments/73238271"},"html":{"href":"https://github.com/dionyziz/rupture/pull/186#discussion_r73238271"},"pull_request":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/186"}}},"pull_request":{"url":"https://api.github.com/repos/dionyziz/rupture/pulls/186","id":79790410,"html_url":"https://github.com/dionyziz/rupture/pull/186","diff_url":"https://github.com/dionyziz/rupture/pull/186.diff","patch_url":"https://github.com/dionyziz/rupture/pull/186.patch","issue_url":"https://api.github.com/repos/dionyziz/rupture/issues/186","number":186,"state":"open","locked":false,"title":"Added sentinel per Target. Added test_next_round , test_same_round_di…","user":{"login":"dimriou","id":20386008,"avatar_url":"https://avatars.githubusercontent.com/u/20386008?v=3","gravatar_id":"","url":"https://api.github.com/users/dimriou","html_url":"https://github.com/dimriou","followers_url":"https://api.github.com/users/dimriou/followers","following_url":"https://api.github.com/users/dimriou/following{/other_user}","gists_url":"https://api.github.com/users/dimriou/gists{/gist_id}","starred_url":"https://api.github.com/users/dimriou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimriou/subscriptions","organizations_url":"https://api.github.com/users/dimriou/orgs","repos_url":"https://api.github.com/users/dimriou/repos","events_url":"https://api.github.com/users/dimriou/events{/privacy}","received_events_url":"https://api.github.com/users/dimriou/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-02T19:04:44Z","updated_at":"2016-08-02T21:10:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd94f158f08b53503fc4fa361c2b9651bcb33125","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dionyziz/rupture/pulls/186/commits","review_comments_url":"https://api.github.com/repos/dionyziz/rupture/pulls/186/comments","review_comment_url":"https://api.github.com/repos/dionyziz/rupture/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dionyziz/rupture/issues/186/comments","statuses_url":"https://api.github.com/repos/dionyziz/rupture/statuses/984c27888daf8f144a5fe62ac4c4c240f297d7d1","head":{"label":"dimriou:backend_tests","ref":"backend_tests","sha":"984c27888daf8f144a5fe62ac4c4c240f297d7d1","user":{"login":"dimriou","id":20386008,"avatar_url":"https://avatars.githubusercontent.com/u/20386008?v=3","gravatar_id":"","url":"https://api.github.com/users/dimriou","html_url":"https://github.com/dimriou","followers_url":"https://api.github.com/users/dimriou/followers","following_url":"https://api.github.com/users/dimriou/following{/other_user}","gists_url":"https://api.github.com/users/dimriou/gists{/gist_id}","starred_url":"https://api.github.com/users/dimriou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimriou/subscriptions","organizations_url":"https://api.github.com/users/dimriou/orgs","repos_url":"https://api.github.com/users/dimriou/repos","events_url":"https://api.github.com/users/dimriou/events{/privacy}","received_events_url":"https://api.github.com/users/dimriou/received_events","type":"User","site_admin":false},"repo":{"id":64783327,"name":"rupture","full_name":"dimriou/rupture","owner":{"login":"dimriou","id":20386008,"avatar_url":"https://avatars.githubusercontent.com/u/20386008?v=3","gravatar_id":"","url":"https://api.github.com/users/dimriou","html_url":"https://github.com/dimriou","followers_url":"https://api.github.com/users/dimriou/followers","following_url":"https://api.github.com/users/dimriou/following{/other_user}","gists_url":"https://api.github.com/users/dimriou/gists{/gist_id}","starred_url":"https://api.github.com/users/dimriou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimriou/subscriptions","organizations_url":"https://api.github.com/users/dimriou/orgs","repos_url":"https://api.github.com/users/dimriou/repos","events_url":"https://api.github.com/users/dimriou/events{/privacy}","received_events_url":"https://api.github.com/users/dimriou/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dimriou/rupture","description":"A framework for BREACH and other compression-based crypto attacks","fork":true,"url":"https://api.github.com/repos/dimriou/rupture","forks_url":"https://api.github.com/repos/dimriou/rupture/forks","keys_url":"https://api.github.com/repos/dimriou/rupture/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimriou/rupture/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimriou/rupture/teams","hooks_url":"https://api.github.com/repos/dimriou/rupture/hooks","issue_events_url":"https://api.github.com/repos/dimriou/rupture/issues/events{/number}","events_url":"https://api.github.com/repos/dimriou/rupture/events","assignees_url":"https://api.github.com/repos/dimriou/rupture/assignees{/user}","branches_url":"https://api.github.com/repos/dimriou/rupture/branches{/branch}","tags_url":"https://api.github.com/repos/dimriou/rupture/tags","blobs_url":"https://api.github.com/repos/dimriou/rupture/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimriou/rupture/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimriou/rupture/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimriou/rupture/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimriou/rupture/statuses/{sha}","languages_url":"https://api.github.com/repos/dimriou/rupture/languages","stargazers_url":"https://api.github.com/repos/dimriou/rupture/stargazers","contributors_url":"https://api.github.com/repos/dimriou/rupture/contributors","subscribers_url":"https://api.github.com/repos/dimriou/rupture/subscribers","subscription_url":"https://api.github.com/repos/dimriou/rupture/subscription","commits_url":"https://api.github.com/repos/dimriou/rupture/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimriou/rupture/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimriou/rupture/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimriou/rupture/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimriou/rupture/contents/{+path}","compare_url":"https://api.github.com/repos/dimriou/rupture/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimriou/rupture/merges","archive_url":"https://api.github.com/repos/dimriou/rupture/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimriou/rupture/downloads","issues_url":"https://api.github.com/repos/dimriou/rupture/issues{/number}","pulls_url":"https://api.github.com/repos/dimriou/rupture/pulls{/number}","milestones_url":"https://api.github.com/repos/dimriou/rupture/milestones{/number}","notifications_url":"https://api.github.com/repos/dimriou/rupture/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimriou/rupture/labels{/name}","releases_url":"https://api.github.com/repos/dimriou/rupture/releases{/id}","deployments_url":"https://api.github.com/repos/dimriou/rupture/deployments","created_at":"2016-08-02T18:46:37Z","updated_at":"2016-08-02T18:46:38Z","pushed_at":"2016-08-02T19:00:47Z","git_url":"git://github.com/dimriou/rupture.git","ssh_url":"git@github.com:dimriou/rupture.git","clone_url":"https://github.com/dimriou/rupture.git","svn_url":"https://github.com/dimriou/rupture","homepage":null,"size":7808,"stargazers_count":0,"watchers_count":0,"language":"TeX","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"dionyziz:develop","ref":"develop","sha":"b7272671c7a022c7ed37bba483a39835746bf7f7","user":{"login":"dionyziz","id":544572,"avatar_url":"https://avatars.githubusercontent.com/u/544572?v=3","gravatar_id":"","url":"https://api.github.com/users/dionyziz","html_url":"https://github.com/dionyziz","followers_url":"https://api.github.com/users/dionyziz/followers","following_url":"https://api.github.com/users/dionyziz/following{/other_user}","gists_url":"https://api.github.com/users/dionyziz/gists{/gist_id}","starred_url":"https://api.github.com/users/dionyziz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dionyziz/subscriptions","organizations_url":"https://api.github.com/users/dionyziz/orgs","repos_url":"https://api.github.com/users/dionyziz/repos","events_url":"https://api.github.com/users/dionyziz/events{/privacy}","received_events_url":"https://api.github.com/users/dionyziz/received_events","type":"User","site_admin":false},"repo":{"id":51319299,"name":"rupture","full_name":"dionyziz/rupture","owner":{"login":"dionyziz","id":544572,"avatar_url":"https://avatars.githubusercontent.com/u/544572?v=3","gravatar_id":"","url":"https://api.github.com/users/dionyziz","html_url":"https://github.com/dionyziz","followers_url":"https://api.github.com/users/dionyziz/followers","following_url":"https://api.github.com/users/dionyziz/following{/other_user}","gists_url":"https://api.github.com/users/dionyziz/gists{/gist_id}","starred_url":"https://api.github.com/users/dionyziz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dionyziz/subscriptions","organizations_url":"https://api.github.com/users/dionyziz/orgs","repos_url":"https://api.github.com/users/dionyziz/repos","events_url":"https://api.github.com/users/dionyziz/events{/privacy}","received_events_url":"https://api.github.com/users/dionyziz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dionyziz/rupture","description":"A framework for BREACH and other compression-based crypto attacks","fork":false,"url":"https://api.github.com/repos/dionyziz/rupture","forks_url":"https://api.github.com/repos/dionyziz/rupture/forks","keys_url":"https://api.github.com/repos/dionyziz/rupture/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dionyziz/rupture/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dionyziz/rupture/teams","hooks_url":"https://api.github.com/repos/dionyziz/rupture/hooks","issue_events_url":"https://api.github.com/repos/dionyziz/rupture/issues/events{/number}","events_url":"https://api.github.com/repos/dionyziz/rupture/events","assignees_url":"https://api.github.com/repos/dionyziz/rupture/assignees{/user}","branches_url":"https://api.github.com/repos/dionyziz/rupture/branches{/branch}","tags_url":"https://api.github.com/repos/dionyziz/rupture/tags","blobs_url":"https://api.github.com/repos/dionyziz/rupture/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dionyziz/rupture/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dionyziz/rupture/git/refs{/sha}","trees_url":"https://api.github.com/repos/dionyziz/rupture/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dionyziz/rupture/statuses/{sha}","languages_url":"https://api.github.com/repos/dionyziz/rupture/languages","stargazers_url":"https://api.github.com/repos/dionyziz/rupture/stargazers","contributors_url":"https://api.github.com/repos/dionyziz/rupture/contributors","subscribers_url":"https://api.github.com/repos/dionyziz/rupture/subscribers","subscription_url":"https://api.github.com/repos/dionyziz/rupture/subscription","commits_url":"https://api.github.com/repos/dionyziz/rupture/commits{/sha}","git_commits_url":"https://api.github.com/repos/dionyziz/rupture/git/commits{/sha}","comments_url":"https://api.github.com/repos/dionyziz/rupture/comments{/number}","issue_comment_url":"https://api.github.com/repos/dionyziz/rupture/issues/comments{/number}","contents_url":"https://api.github.com/repos/dionyziz/rupture/contents/{+path}","compare_url":"https://api.github.com/repos/dionyziz/rupture/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dionyziz/rupture/merges","archive_url":"https://api.github.com/repos/dionyziz/rupture/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dionyziz/rupture/downloads","issues_url":"https://api.github.com/repos/dionyziz/rupture/issues{/number}","pulls_url":"https://api.github.com/repos/dionyziz/rupture/pulls{/number}","milestones_url":"https://api.github.com/repos/dionyziz/rupture/milestones{/number}","notifications_url":"https://api.github.com/repos/dionyziz/rupture/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dionyziz/rupture/labels{/name}","releases_url":"https://api.github.com/repos/dionyziz/rupture/releases{/id}","deployments_url":"https://api.github.com/repos/dionyziz/rupture/deployments","created_at":"2016-02-08T19:01:04Z","updated_at":"2016-07-27T00:13:49Z","pushed_at":"2016-08-02T19:04:45Z","git_url":"git://github.com/dionyziz/rupture.git","ssh_url":"git@github.com:dionyziz/rupture.git","clone_url":"https://github.com/dionyziz/rupture.git","svn_url":"https://github.com/dionyziz/rupture","homepage":null,"size":8966,"stargazers_count":103,"watchers_count":103,"language":"TeX","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":38,"forks":17,"open_issues":38,"watchers":103,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/186"},"html":{"href":"https://github.com/dionyziz/rupture/pull/186"},"issue":{"href":"https://api.github.com/repos/dionyziz/rupture/issues/186"},"comments":{"href":"https://api.github.com/repos/dionyziz/rupture/issues/186/comments"},"review_comments":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/186/comments"},"review_comment":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/186/commits"},"statuses":{"href":"https://api.github.com/repos/dionyziz/rupture/statuses/984c27888daf8f144a5fe62ac4c4c240f297d7d1"}}}}
{"actor":{"display_login":"dionyziz"}}