def test_extraneous_word_token_before_api_token(self): extraneous_word_token = "Token " + TOKEN client = Client(api_token=extraneous_word_token, api_root=API_ROOT) s102 = client.fetch(query="/test/acts/47/1") assert s102["start_date"] == "1935-04-01" assert s102["end_date"] is None assert s102["heading"] == "Short title"
def test_no_api_token(self): bad_client = Client() with pytest.raises(LegisliceTokenError): bad_client.fetch(query="/test/acts/47/1")
def test_wrong_api_token(self): bad_client = Client(api_token="wr0ngToken") with pytest.raises(LegisliceTokenError): bad_client.fetch(query="/test/acts/47/1")