def test_resolve_all_pool_configs_0(self):
        buffered_pool_configs = []
        pool_config_resolver = BufferPoolConfigurationResolver(
            buffered_pool_configs)

        actual_pool_configs = pool_config_resolver.resolve_all()

        self.assertListEqual(buffered_pool_configs, actual_pool_configs)
    def test_resolve_all_pool_configs_1(self):
        pool_config = PoolConfiguration('ignored')
        buffered_pool_configs = [pool_config]
        pool_config_resolver = BufferPoolConfigurationResolver(
            buffered_pool_configs)

        actual_pool_configs = pool_config_resolver.resolve_all()

        self.assertListEqual(buffered_pool_configs, actual_pool_configs)
    def test_no_pool_config_and_no_pool_user_config(self):
        pool_config_resolver = BufferPoolConfigurationResolver([])
        pool_user_config_resolver = BufferPoolUserConfigurationResolver([])
        pool_selector = PoolSelector(pool_config_resolver,
                                     pool_user_config_resolver)

        pool_selection_info = PoolSelectionInfo('pool1', 'currency1', 'algo1')

        configs = pool_selector.select_pool(pool_selection_info)

        self.assertIsNone(configs)
    def test_matches_pool_config_and_matches_pool_user_config(self):
        pool_config_resolver = BufferPoolConfigurationResolver(
            [PoolConfiguration('pool1', [])])
        pool_user_config_resolver = BufferPoolUserConfigurationResolver(
            [PoolUserConfiguration('pool1', 'user1', 'pass1')])
        pool_selector = PoolSelector(pool_config_resolver,
                                     pool_user_config_resolver)

        pool_selection_info = PoolSelectionInfo('pool1', 'currency1', 'algo1')

        configs = pool_selector.select_pool(pool_selection_info)

        self.assertIsNotNone(configs)

        pool_config, pool_user_config = configs

        self.assertEqual('pool1', pool_config.pool_name)
        self.assertEqual('pool1', pool_user_config.pool_name)