GitHub PullRequestReviewCommentEvent at 2014-05-15 11:12:06
Repository: presence-analyzer-apardon
Actor: artpard
Payload: {"comment":{"url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-apardon/pulls/comments/12683604","id":12683604,"diff_hunk":"@@ -84,6 +105,53 @@ def test_get_data(self):\n         self.assertEqual(data[10][sample_date]['start'],\n                          datetime.time(9, 39, 5))\n \n+    def test_mean(self):\n+        \"\"\"\n+        Test calculating arithmetic mean\n+        \"\"\"\n+        self.assertIsInstance(utils.mean([1, 2, 3]), float)\n+        self.assertEqual(utils.mean([1, 2, 3]), 2)\n+        self.assertEqual(utils.mean([-10, 10]), 0)\n+\n+    def test_seconds_since_midnight(self):\n+        \"\"\"\n+        Test calculating amount on seconds since midnight\n+        \"\"\"\n+        self.assertIsInstance(utils.seconds_since_midnight(\n+            datetime.datetime.now()), int)\n+        self.assertNotEqual(datetime.time(15, 44, 32), 3000)\n+\n+    def test_interval(self):\n+        \"\"\"\n+        Test calculating interval between two datetime.time objects in seconds\n+        \"\"\"\n+        start = datetime.datetime.now()\n+        end = datetime.datetime.now() + datetime.timedelta(hours=1)\n+        self.assertIsInstance(utils.interval(start, end), int)\n+        self.assertEqual(utils.interval(start, end), 3600)\n+\n+    def test_group_by_weekday(self):\n+        \"\"\"\n+        Test groups presence entris by weekday\n+        \"\"\"\n+        sample_date = {\n+            datetime.date(2013, 10, 1): {\n+                'start': datetime.time(9, 0, 0),\n+                'end': datetime.time(17, 30, 0),\n+            },\n+        }\n+        expected_result = {\n+            0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 6: []","path":"src/presence_analyzer/tests.py","position":null,"original_position":68,"commit_id":"7dca798ddbf650c2abb7744a4ce0b0837d81b268","original_commit_id":"22604af3beb243b6e53cd7c9f604cc64fb0c9591","user":{"login":"artpard","id":7522228,"avatar_url":"https://avatars.githubusercontent.com/u/7522228?","gravatar_id":"d665586c474bbe24b64d4a34a04843d0","url":"https://api.github.com/users/artpard","html_url":"https://github.com/artpard","followers_url":"https://api.github.com/users/artpard/followers","following_url":"https://api.github.com/users/artpard/following{/other_user}","gists_url":"https://api.github.com/users/artpard/gists{/gist_id}","starred_url":"https://api.github.com/users/artpard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artpard/subscriptions","organizations_url":"https://api.github.com/users/artpard/orgs","repos_url":"https://api.github.com/users/artpard/repos","events_url":"https://api.github.com/users/artpard/events{/privacy}","received_events_url":"https://api.github.com/users/artpard/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2014-05-15T11:12:06Z","updated_at":"2014-05-15T11:12:06Z","html_url":"https://github.com/stxnext-kindergarten/presence-analyzer-apardon/pull/2#discussion_r12683604","pull_request_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-apardon/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-apardon/pulls/comments/12683604"},"html":{"href":"https://github.com/stxnext-kindergarten/presence-analyzer-apardon/pull/2#discussion_r12683604"},"pull_request":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-apardon/pulls/2"}}}}