def test_get_name_returns_localized_week_day_name(self): day = WeekDay(0) assert day.get_name() == u'maanantaina'
def test_override_get_locale_as_class_method(self): day = WeekDay(0) assert day.get_name() == u'maanantaina'
def test_str(self): day = WeekDay(0) flexmock(day).should_receive('name').and_return(u'maanantaina') assert str(day) == 'maanantaina'
def test_constructor_with_valid_bit_string(self): days = WeekDays('1000100') assert days._days == set([WeekDay(0), WeekDay(4)])
def test_name_delegates_to_get_name(self): day = WeekDay(0) flexmock(day).should_receive('get_name').and_return(u'maanantaina') assert day.name == u'maanantaina'
def test_unicode(self): day = WeekDay(0) flexmock(day).should_receive('name').and_return(u'maanantaina') assert six.text_type(day) == u'maanantaina'
def test_representation(self): day = WeekDay(1) assert repr(day) == "WeekDay(1)"
def test_position(self, index, first_week_day, position): i18n.get_locale = flexmock(first_week_day=first_week_day) day = WeekDay(index) assert day.position == position
def test_hash_is_equal_to_index_hash(self): day = WeekDay(1) assert hash(day) == hash(day.index)
def test_equality_with_unsupported_comparison(self): day = WeekDay(1) assert day != 'foobar'
def test_equality_with_unequal_week_day(self): day = WeekDay(1) day2 = WeekDay(2) assert day != day2
def test_constructor_with_invalid_index(self, index): with pytest.raises(ValueError): WeekDay(index)
def test_constructor_with_valid_index(self): day = WeekDay(1) assert day.index == 1