Ejemplo n.º 1
0
    def test_set_conversion(self):
        raw_string = 'string'
        correct_string = raw_string.upper()
        r = RanCat()
        r.set_conversion(str.upper)
        processed_string = r._conversion(raw_string)
        assert processed_string == correct_string

        # Test TypeError gets raised
        with pytest.raises(TypeError):
            r.set_conversion("hello")
Ejemplo n.º 2
0
    def test_set_conversion(self):
        raw_string = 'string'
        correct_string = raw_string.upper()
        r = RanCat()
        r.set_conversion(str.upper)
        processed_string = r._conversion(raw_string)
        assert processed_string == correct_string

        # Test TypeError gets raised
        with pytest.raises(TypeError):
            r.set_conversion("hello")
Ejemplo n.º 3
0
 def test_default_conversion(self):
     raw_string = 'S\'tr ing   '
     correct_string = 'Str_ing'
     r = RanCat()
     processed_string = r._conversion(raw_string, r._separator)
     assert processed_string == correct_string
Ejemplo n.º 4
0
 def test_default_conversion(self):
     raw_string = 'S\'tr ing   '
     correct_string = 'Str_ing'
     r = RanCat()
     processed_string = r._conversion(raw_string, r._separator)
     assert processed_string == correct_string