def test_plugin_properties_name_desc(self): plugin = FirebasePlugin({}, is_android=True, is_ios=False, do_online=False) assert not plugin.name.startswith('Base') assert not plugin.desc.startswith('Base')
def test_check_bucket_redirect(self, requests_mock): db_name = 'test' requests_mock.head('https://storage.googleapis.com/' + db_name + '.appspot.com', status_code=301) message = FirebasePlugin.check_bucket(db_name) assert message is None
def test_check_bucket_valid(self, requests_mock): db_name = 'test' requests_mock.head('https://storage.googleapis.com/' + db_name + '.appspot.com', status_code=200) message = FirebasePlugin.check_bucket(db_name) assert message == '---- ISSUE: Unprotected bucket found - https://storage.googleapis.com/'\ + db_name + '.appspot.com'
def test_is_online_testing_supported(self): plugin = FirebasePlugin({}, is_android=False, is_ios=False, do_online=False) assert plugin.is_online_testing_supported() is False plugin = FirebasePlugin({}, is_android=False, is_ios=False, do_online=True) assert plugin.is_online_testing_supported() is True
def test_check_firebase_db_not_found(self, requests_mock): db_name = 'test' requests_mock.get('https://' + db_name + '.firebaseio.com/.json', status_code=404) message = FirebasePlugin.check_firebase_db(db_name) assert message is None
def test_check_firebase_db_valid(self, requests_mock): db_name = 'test' requests_mock.get('https://' + db_name + '.firebaseio.com/.json', status_code=200) message = FirebasePlugin.check_firebase_db(db_name) assert message == '---- ISSUE: Unprotected Firebase DB found - https://' + db_name + '.firebaseio.com/.json'