Test deserialization of popularity and authority metrics
@@ -178,3 +178,22 @@ class TestCleanup:
expected_http = "'http://neverssl.com'"
assert result == expected
assert result_http == expected_http
+
+ @staticmethod
+ def test_normalized_score_override():
+ meta = {'normalized_popularity': 27}
+ img = create_mock_image({'meta_data': meta})
+ assert img.normalized_popularity == 27
+
+ @staticmethod
+ def test_score_constrained():
+ meta = {'normalized_popularity': 200}
+ img = create_mock_image({'meta_data': meta})
+ assert img.normalized_popularity == 100
+
+ @staticmethod
+ def test_authority_override():
+ meta = {'authority_boost': 25, 'authority_penalty': 10}
+ img = create_mock_image({'meta_data': meta})
+ assert img.authority_boost == 25
+ assert img.authority_penalty == 10
