예제 #1
0
    def test_get_default_config(self):
        ext = SoundCloudExtension()

        config = ext.get_default_config()

        self.assertIn('[soundcloud]', config)
        self.assertIn('enabled = True', config)
예제 #2
0
    def test_get_config_schema(self):
        ext = SoundCloudExtension()

        schema = ext.get_config_schema()

        self.assertIn('auth_token', schema)
        self.assertIn('explore_songs', schema)
예제 #3
0
    def test_get_default_config(self):
        ext = SoundCloudExtension()

        config = ext.get_default_config()

        self.assertIn('[soundcloud]', config)
        self.assertIn('enabled = True', config)
예제 #4
0
    def test_get_config_schema(self):
        ext = SoundCloudExtension()

        schema = ext.get_config_schema()

        self.assertIn('auth_token', schema)
        self.assertIn('explore_songs', schema)
예제 #5
0
 def test_responds_with_error(self):
     with mock.patch('mopidy_soundcloud.soundcloud.logger.error') as d:
         config = SoundCloudExtension().get_config_schema()
         config['auth_token'] = '1-fake-token'
         SoundCloudClient(config)
         d.assert_called_once_with('Invalid "auth_token" used for '
                                   'SoundCloud authentication!')
예제 #6
0
 def setUp(self):
     config = SoundCloudExtension().get_config_schema()
     config['auth_token'] = '1-35204-61921957-55796ebef403996'
     # using this user http://maildrop.cc/inbox/mopidytestuser
     self.backend = actor.SoundCloudBackend.start(config={
         'soundcloud': config
     },
                                                  audio=None).proxy()
     self.library = SoundCloudLibraryProvider(backend=self.backend)
예제 #7
0
 def setUp(self):
     config = SoundCloudExtension().get_config_schema()
     config['auth_token'] = '1-35204-61921957-55796ebef403996'
     config['explore_songs'] = 10
     # using this user http://maildrop.cc/inbox/mopidytestuser
     self.api = SoundCloudClient(config)
예제 #8
0
 def setUp(self):
     config = SoundCloudExtension().get_config_schema()
     config['auth_token'] = '1-35204-61921957-55796ebef403996'
     config['explore_songs'] = 10
     self.api = SoundCloudClient({'soundcloud': config, 'proxy': {}})