{"action":"created","comment":{"url":"https://api.github.com/repos/internaphosting/netman/pulls/comments/44592784","id":44592784,"diff_hunk":"@@ -0,0 +1,53 @@\n+# Copyright 2015 Internap.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+from hamcrest import assert_that, is_, none, empty, has_item, has_properties\n+from netman.core.objects.access_groups import IN, OUT\n+from netman.core.objects.exceptions import BadVlanNumber, BadVlanName, \\\n+    BondAlreadyExist, BadBondNumber\n+from netman.core.objects.port_modes import DYNAMIC\n+\n+from tests.adapters.configured_test_case import ConfiguredTestCase\n+\n+\n+class AddBondTest(ConfiguredTestCase):\n+    _dev_sample = \"cisco\"\n+\n+    def test_creates_an_empty_bond(self):\n+        self.client.add_bond(10)\n+\n+        bonds = self.client.get_bonds()\n+        assert_that(bonds, has_item(has_properties(number=10)))\n+\n+        bond = next((b for b in bonds if b.number == 10))\n+        assert_that(bond.number, is_(10))\n+        assert_that(bond.members, is_([]))\n+        assert_that(bond.link_speed, is_(None))\n+        assert_that(bond.shutdown, is_(False))\n+        assert_that(bond.port_mode, is_(DYNAMIC))\n+        assert_that(bond.access_vlan, is_(None))\n+        assert_that(bond.trunk_native_vlan, is_(None))\n+        assert_that(bond.trunk_vlans, is_([]))\n+\n+    def test_fails_if_the_bond_already_exist(self):\n+        self.client.add_bond(10)\n+\n+        with self.assertRaises(BondAlreadyExist):\n+            self.client.add_bond(10)\n+","path":"tests/adapters/compliance_tests/add_bond_test.py","position":48,"original_position":48,"commit_id":"44d1ba826d6a7e257125b17dd5b8fd0410f59831","original_commit_id":"44d1ba826d6a7e257125b17dd5b8fd0410f59831","user":{"login":"lindycoder","id":12926519,"avatar_url":"https://avatars.githubusercontent.com/u/12926519?v=3","gravatar_id":"","url":"https://api.github.com/users/lindycoder","html_url":"https://github.com/lindycoder","followers_url":"https://api.github.com/users/lindycoder/followers","following_url":"https://api.github.com/users/lindycoder/following{/other_user}","gists_url":"https://api.github.com/users/lindycoder/gists{/gist_id}","starred_url":"https://api.github.com/users/lindycoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindycoder/subscriptions","organizations_url":"https://api.github.com/users/lindycoder/orgs","repos_url":"https://api.github.com/users/lindycoder/repos","events_url":"https://api.github.com/users/lindycoder/events{/privacy}","received_events_url":"https://api.github.com/users/lindycoder/received_events","type":"User","site_admin":false},"body":"test_fails_with_an_invalid_number  could be relevant","created_at":"2015-11-11T21:59:49Z","updated_at":"2015-11-11T21:59:49Z","html_url":"https://github.com/internaphosting/netman/pull/45#discussion_r44592784","pull_request_url":"https://api.github.com/repos/internaphosting/netman/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/internaphosting/netman/pulls/comments/44592784"},"html":{"href":"https://github.com/internaphosting/netman/pull/45#discussion_r44592784"},"pull_request":{"href":"https://api.github.com/repos/internaphosting/netman/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/internaphosting/netman/pulls/45","id":50436407,"html_url":"https://github.com/internaphosting/netman/pull/45","diff_url":"https://github.com/internaphosting/netman/pull/45.diff","patch_url":"https://github.com/internaphosting/netman/pull/45.patch","issue_url":"https://api.github.com/repos/internaphosting/netman/issues/45","number":45,"state":"open","locked":false,"title":"Add bond support on cisco","user":{"login":"JoProvost","id":1084038,"avatar_url":"https://avatars.githubusercontent.com/u/1084038?v=3","gravatar_id":"","url":"https://api.github.com/users/JoProvost","html_url":"https://github.com/JoProvost","followers_url":"https://api.github.com/users/JoProvost/followers","following_url":"https://api.github.com/users/JoProvost/following{/other_user}","gists_url":"https://api.github.com/users/JoProvost/gists{/gist_id}","starred_url":"https://api.github.com/users/JoProvost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoProvost/subscriptions","organizations_url":"https://api.github.com/users/JoProvost/orgs","repos_url":"https://api.github.com/users/JoProvost/repos","events_url":"https://api.github.com/users/JoProvost/events{/privacy}","received_events_url":"https://api.github.com/users/JoProvost/received_events","type":"User","site_admin":false},"body":" - Add bond\r\n - Remove bond\r\n - Get bond\r\n - Get bonds\r\n - Add interface to bond\r\n - Remove interface from bond","created_at":"2015-11-11T21:07:52Z","updated_at":"2015-11-11T21:59:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"20a5453f03a1132adb7d8778b6e8fd4c052b8c34","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/internaphosting/netman/pulls/45/commits","review_comments_url":"https://api.github.com/repos/internaphosting/netman/pulls/45/comments","review_comment_url":"https://api.github.com/repos/internaphosting/netman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/internaphosting/netman/issues/45/comments","statuses_url":"https://api.github.com/repos/internaphosting/netman/statuses/44d1ba826d6a7e257125b17dd5b8fd0410f59831","head":{"label":"JoProvost:bond_on_cisco","ref":"bond_on_cisco","sha":"44d1ba826d6a7e257125b17dd5b8fd0410f59831","user":{"login":"JoProvost","id":1084038,"avatar_url":"https://avatars.githubusercontent.com/u/1084038?v=3","gravatar_id":"","url":"https://api.github.com/users/JoProvost","html_url":"https://github.com/JoProvost","followers_url":"https://api.github.com/users/JoProvost/followers","following_url":"https://api.github.com/users/JoProvost/following{/other_user}","gists_url":"https://api.github.com/users/JoProvost/gists{/gist_id}","starred_url":"https://api.github.com/users/JoProvost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoProvost/subscriptions","organizations_url":"https://api.github.com/users/JoProvost/orgs","repos_url":"https://api.github.com/users/JoProvost/repos","events_url":"https://api.github.com/users/JoProvost/events{/privacy}","received_events_url":"https://api.github.com/users/JoProvost/received_events","type":"User","site_admin":false},"repo":{"id":44604332,"name":"netman","full_name":"JoProvost/netman","owner":{"login":"JoProvost","id":1084038,"avatar_url":"https://avatars.githubusercontent.com/u/1084038?v=3","gravatar_id":"","url":"https://api.github.com/users/JoProvost","html_url":"https://github.com/JoProvost","followers_url":"https://api.github.com/users/JoProvost/followers","following_url":"https://api.github.com/users/JoProvost/following{/other_user}","gists_url":"https://api.github.com/users/JoProvost/gists{/gist_id}","starred_url":"https://api.github.com/users/JoProvost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoProvost/subscriptions","organizations_url":"https://api.github.com/users/JoProvost/orgs","repos_url":"https://api.github.com/users/JoProvost/repos","events_url":"https://api.github.com/users/JoProvost/events{/privacy}","received_events_url":"https://api.github.com/users/JoProvost/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JoProvost/netman","description":"A unified REST API to provide vendor-agnostic network automation","fork":true,"url":"https://api.github.com/repos/JoProvost/netman","forks_url":"https://api.github.com/repos/JoProvost/netman/forks","keys_url":"https://api.github.com/repos/JoProvost/netman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JoProvost/netman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JoProvost/netman/teams","hooks_url":"https://api.github.com/repos/JoProvost/netman/hooks","issue_events_url":"https://api.github.com/repos/JoProvost/netman/issues/events{/number}","events_url":"https://api.github.com/repos/JoProvost/netman/events","assignees_url":"https://api.github.com/repos/JoProvost/netman/assignees{/user}","branches_url":"https://api.github.com/repos/JoProvost/netman/branches{/branch}","tags_url":"https://api.github.com/repos/JoProvost/netman/tags","blobs_url":"https://api.github.com/repos/JoProvost/netman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JoProvost/netman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JoProvost/netman/git/refs{/sha}","trees_url":"https://api.github.com/repos/JoProvost/netman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JoProvost/netman/statuses/{sha}","languages_url":"https://api.github.com/repos/JoProvost/netman/languages","stargazers_url":"https://api.github.com/repos/JoProvost/netman/stargazers","contributors_url":"https://api.github.com/repos/JoProvost/netman/contributors","subscribers_url":"https://api.github.com/repos/JoProvost/netman/subscribers","subscription_url":"https://api.github.com/repos/JoProvost/netman/subscription","commits_url":"https://api.github.com/repos/JoProvost/netman/commits{/sha}","git_commits_url":"https://api.github.com/repos/JoProvost/netman/git/commits{/sha}","comments_url":"https://api.github.com/repos/JoProvost/netman/comments{/number}","issue_comment_url":"https://api.github.com/repos/JoProvost/netman/issues/comments{/number}","contents_url":"https://api.github.com/repos/JoProvost/netman/contents/{+path}","compare_url":"https://api.github.com/repos/JoProvost/netman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JoProvost/netman/merges","archive_url":"https://api.github.com/repos/JoProvost/netman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JoProvost/netman/downloads","issues_url":"https://api.github.com/repos/JoProvost/netman/issues{/number}","pulls_url":"https://api.github.com/repos/JoProvost/netman/pulls{/number}","milestones_url":"https://api.github.com/repos/JoProvost/netman/milestones{/number}","notifications_url":"https://api.github.com/repos/JoProvost/netman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JoProvost/netman/labels{/name}","releases_url":"https://api.github.com/repos/JoProvost/netman/releases{/id}","created_at":"2015-10-20T12:20:52Z","updated_at":"2015-10-20T12:20:52Z","pushed_at":"2015-11-11T21:07:22Z","git_url":"git://github.com/JoProvost/netman.git","ssh_url":"git@github.com:JoProvost/netman.git","clone_url":"https://github.com/JoProvost/netman.git","svn_url":"https://github.com/JoProvost/netman","homepage":null,"size":506,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"master"}},"base":{"label":"internaphosting:master","ref":"master","sha":"6bf25f23bc01a5fc1c8ca3bf568ad0a2636614e9","user":{"login":"internaphosting","id":13888621,"avatar_url":"https://avatars.githubusercontent.com/u/13888621?v=3","gravatar_id":"","url":"https://api.github.com/users/internaphosting","html_url":"https://github.com/internaphosting","followers_url":"https://api.github.com/users/internaphosting/followers","following_url":"https://api.github.com/users/internaphosting/following{/other_user}","gists_url":"https://api.github.com/users/internaphosting/gists{/gist_id}","starred_url":"https://api.github.com/users/internaphosting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/internaphosting/subscriptions","organizations_url":"https://api.github.com/users/internaphosting/orgs","repos_url":"https://api.github.com/users/internaphosting/repos","events_url":"https://api.github.com/users/internaphosting/events{/privacy}","received_events_url":"https://api.github.com/users/internaphosting/received_events","type":"Organization","site_admin":false},"repo":{"id":42546590,"name":"netman","full_name":"internaphosting/netman","owner":{"login":"internaphosting","id":13888621,"avatar_url":"https://avatars.githubusercontent.com/u/13888621?v=3","gravatar_id":"","url":"https://api.github.com/users/internaphosting","html_url":"https://github.com/internaphosting","followers_url":"https://api.github.com/users/internaphosting/followers","following_url":"https://api.github.com/users/internaphosting/following{/other_user}","gists_url":"https://api.github.com/users/internaphosting/gists{/gist_id}","starred_url":"https://api.github.com/users/internaphosting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/internaphosting/subscriptions","organizations_url":"https://api.github.com/users/internaphosting/orgs","repos_url":"https://api.github.com/users/internaphosting/repos","events_url":"https://api.github.com/users/internaphosting/events{/privacy}","received_events_url":"https://api.github.com/users/internaphosting/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/internaphosting/netman","description":"A unified REST API to provide vendor-agnostic network automation","fork":false,"url":"https://api.github.com/repos/internaphosting/netman","forks_url":"https://api.github.com/repos/internaphosting/netman/forks","keys_url":"https://api.github.com/repos/internaphosting/netman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/internaphosting/netman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/internaphosting/netman/teams","hooks_url":"https://api.github.com/repos/internaphosting/netman/hooks","issue_events_url":"https://api.github.com/repos/internaphosting/netman/issues/events{/number}","events_url":"https://api.github.com/repos/internaphosting/netman/events","assignees_url":"https://api.github.com/repos/internaphosting/netman/assignees{/user}","branches_url":"https://api.github.com/repos/internaphosting/netman/branches{/branch}","tags_url":"https://api.github.com/repos/internaphosting/netman/tags","blobs_url":"https://api.github.com/repos/internaphosting/netman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/internaphosting/netman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/internaphosting/netman/git/refs{/sha}","trees_url":"https://api.github.com/repos/internaphosting/netman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/internaphosting/netman/statuses/{sha}","languages_url":"https://api.github.com/repos/internaphosting/netman/languages","stargazers_url":"https://api.github.com/repos/internaphosting/netman/stargazers","contributors_url":"https://api.github.com/repos/internaphosting/netman/contributors","subscribers_url":"https://api.github.com/repos/internaphosting/netman/subscribers","subscription_url":"https://api.github.com/repos/internaphosting/netman/subscription","commits_url":"https://api.github.com/repos/internaphosting/netman/commits{/sha}","git_commits_url":"https://api.github.com/repos/internaphosting/netman/git/commits{/sha}","comments_url":"https://api.github.com/repos/internaphosting/netman/comments{/number}","issue_comment_url":"https://api.github.com/repos/internaphosting/netman/issues/comments{/number}","contents_url":"https://api.github.com/repos/internaphosting/netman/contents/{+path}","compare_url":"https://api.github.com/repos/internaphosting/netman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/internaphosting/netman/merges","archive_url":"https://api.github.com/repos/internaphosting/netman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/internaphosting/netman/downloads","issues_url":"https://api.github.com/repos/internaphosting/netman/issues{/number}","pulls_url":"https://api.github.com/repos/internaphosting/netman/pulls{/number}","milestones_url":"https://api.github.com/repos/internaphosting/netman/milestones{/number}","notifications_url":"https://api.github.com/repos/internaphosting/netman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/internaphosting/netman/labels{/name}","releases_url":"https://api.github.com/repos/internaphosting/netman/releases{/id}","created_at":"2015-09-15T21:06:05Z","updated_at":"2015-11-09T10:59:48Z","pushed_at":"2015-11-11T21:07:52Z","git_url":"git://github.com/internaphosting/netman.git","ssh_url":"git@github.com:internaphosting/netman.git","clone_url":"https://github.com/internaphosting/netman.git","svn_url":"https://github.com/internaphosting/netman","homepage":null,"size":952,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":7,"forks":6,"open_issues":7,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/internaphosting/netman/pulls/45"},"html":{"href":"https://github.com/internaphosting/netman/pull/45"},"issue":{"href":"https://api.github.com/repos/internaphosting/netman/issues/45"},"comments":{"href":"https://api.github.com/repos/internaphosting/netman/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/internaphosting/netman/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/internaphosting/netman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/internaphosting/netman/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/internaphosting/netman/statuses/44d1ba826d6a7e257125b17dd5b8fd0410f59831"}}}}