from __future__ import unicode_literals

# import unittest

from . import TestCase, PY3

from competitions.match import config as match_config
from competitions.cup import CupFinished, config as cup_config
from competitions.cup.default.StepladderCup import StepladderCup

if PY3:
    unicode = str


CupClass = cup_config.cup('competitions.stepladder')


class TestStepladderCup(TestCase):

    """Tests for standard stepladder cups."""

    @classmethod
    def setUpClass(cls):
        """Class setup code."""
        match_config.base_match = 'competitions.test'

    def test_class_loading(self):
        """Test the equality of class loaded through setuptools with direct import."""
        self.assertEqual(CupClass, StepladderCup, 'Classes not the same.')
Пример #2
0
 def test_basic(self):
     """Test loading of cup classes."""
     self.assertEqual(config.cup('competitions.poweroftwo_single'),
                      PowerOfTwoSingleEliminationCup)
     self.assertRaises(KeyError, config.cup, 'competitions.unused')
from __future__ import unicode_literals

# import unittest

from . import TestCase, PY3

from competitions.match import config as match_config
from competitions.cup import CupFinished, config as cup_config
from competitions.cup.default.PowerOfTwoSingleEliminationCup import PowerOfTwoSingleEliminationCup

if PY3:
    unicode = str


CupClass = cup_config.cup('competitions.poweroftwo_single')


class TestPowerOfTwoSingleEliminationCup(TestCase):

    """Tests for standard single-elimination cup for powers of two."""

    @classmethod
    def setUpClass(cls):
        """Class setup code."""
        match_config.base_match = 'competitions.test'

    def test_class_loading(self):
        """Test the equality of class loaded through setuptools with direct import."""
        self.assertEqual(CupClass, PowerOfTwoSingleEliminationCup,
                         'Classes not the same.')
from __future__ import unicode_literals

# import unittest

from . import TestCase, PY3

from competitions.match import config as match_config
from competitions.cup import CupFinished, config as cup_config
from competitions.cup.default.StandardSingleEliminationCup import StandardSingleEliminationCup

if PY3:
    unicode = str


CupClass = cup_config.cup("competitions.standard_single")


class TestStandardSingleEliminationCup(TestCase):

    """Tests for standard single-elimination cups."""

    @classmethod
    def setUpClass(cls):
        """Class setup code."""
        match_config.base_match = "competitions.test"

    def test_class_loading(self):
        """Test the equality of class loaded through setuptools with direct import."""
        self.assertEqual(CupClass, StandardSingleEliminationCup, "Classes not the same.")