コード例 #1
0
 def test_config_file_updated_with_oxd_id(self, mock_set):
     c = Client(initial_config)
     c.msgr.request = MagicMock(return_value=self.success)
     c.oxd_id = None
     c.register_site()
     mock_set.assert_called_with('oxd', 'id',
                                 '6F9619FF-8B86-D011-B42D-00CF4FC964FF')
コード例 #2
0
 def test_raises_exception_when_oxd_returns_error(self):
     config = os.path.join(this_dir, 'data', 'no_auth_uri.cfg')
     c = Client(config)
     c.msgr.request = MagicMock(return_value=generic_error)
     with pytest.raises(OxdServerError):
         c.register_site()
コード例 #3
0
 def test_no_request_sent_if_already_registered(self):
     c = Client(initial_config)
     c.msgr.request = MagicMock(return_value=self.success)
     assert c.register_site() == 'test-id'
     c.msgr.request.assert_not_called()