@@ -44,22 +44,52 @@ def test_sync_on_update_upload_token_required_for_public_repos(self, mock_publis
4444 owner = OwnerFactory (ownerid = 12345 , upload_token_required_for_public_repos = True )
4545 owner .upload_token_required_for_public_repos = False
4646 owner .save ()
47- mock_publish .assert_not_called ()
47+ mock_publish .assert_has_calls (
48+ [
49+ call (
50+ "projects/test-project-id/topics/test-topic-id" ,
51+ b'{"type": "owner", "sync": "one", "id": 12345}' ,
52+ ),
53+ call (
54+ "projects/test-project-id/topics/test-topic-id" ,
55+ b'{"type": "owner", "sync": "one", "id": 12345}' ,
56+ ),
57+ ]
58+ )
4859
4960 def test_sync_on_update_username (self , mock_publish ):
5061 owner = OwnerFactory (ownerid = 12345 , username = "hello" )
5162 owner .username = "world"
5263 owner .save ()
53- mock_publish .assert_called_once_with (
54- "projects/test-project-id/topics/test-topic-id" ,
55- b'{"type": "owner", "sync": "one", "id": 12345}' ,
64+ mock_publish .assert_has_calls (
65+ [
66+ call (
67+ "projects/test-project-id/topics/test-topic-id" ,
68+ b'{"type": "owner", "sync": "one", "id": 12345}' ,
69+ ),
70+ call (
71+ "projects/test-project-id/topics/test-topic-id" ,
72+ b'{"type": "owner", "sync": "one", "id": 12345}' ,
73+ ),
74+ ]
5675 )
5776
5877 def test_sync_on_update_service (self , mock_publish ):
5978 owner = OwnerFactory (ownerid = 12345 , service = Service .GITHUB .value )
6079 owner .service = Service .BITBUCKET .value
6180 owner .save ()
62- mock_publish .assert_not_called ()
81+ mock_publish .assert_has_calls (
82+ [
83+ call (
84+ "projects/test-project-id/topics/test-topic-id" ,
85+ b'{"type": "owner", "sync": "one", "id": 12345}' ,
86+ ),
87+ call (
88+ "projects/test-project-id/topics/test-topic-id" ,
89+ b'{"type": "owner", "sync": "one", "id": 12345}' ,
90+ ),
91+ ]
92+ )
6393
6494 def test_no_sync_on_update_other_fields (self , mock_publish ):
6595 owner = OwnerFactory (ownerid = 12345 , name = "hello" )
0 commit comments