Ejemplo n.º 1
0
 def send(self, data, *more, sep=" ", end="\n"):
     return self._output.append(joins(data, *more, sep=sep) + end)
Ejemplo n.º 2
0
 def send(self, data, *more, sep=" ", end="\n"):
     return self._output.append(joins(data, *more, sep=sep) + end)
Ejemplo n.º 3
0
def test_joins_given_separator():
    """Test that we can join with a given separator."""
    assert funcs.joins(10, 2, 2014, sep="/") == "10/2/2014"
Ejemplo n.º 4
0
def test_joins_empty_strings():
    """Test that it won't bother joining a sequence of empty strings."""
    assert funcs.joins("", "", "") == ""
Ejemplo n.º 5
0
def test_joins_non_strings():
    """Test that we can join both strings and non-strings."""
    assert funcs.joins("test", "number", 3) == "test number 3"
Ejemplo n.º 6
0
def test_joins_strings():
    """Test that we can join some strings."""
    assert funcs.joins("this ", "is a", "test") == "this  is a test"
Ejemplo n.º 7
0
def test_joins_nothing():
    """Test that joining nothing gets us nothing."""
    assert funcs.joins() == ""