Пример #1
0
 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')
Пример #2
0
 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
Пример #3
0
 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'
Пример #4
0
 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
Пример #5
0
 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
Пример #6
0
 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'