class TestAuthorsClass:

    def setup(self):
        self.a1 = Author("Bob Dole", "*****@*****.**")
        self.a2 = Author("Joe Schmoe", "*****@*****.**")
        self.sut = Authors()

    def test_find_returns_correctly(self):
        eq_(self.a1, self.sut.find(self.a1.name, self.a1.email))
        eq_(self.a1, self.sut.find(self.a1.name, self.a1.email))
        eq_(self.a2, self.sut.find(self.a2.name, self.a2.email))

    def test_str_works_correctly(self):
        self.sut.find(self.a1.name, self.a1.email)
        self.sut.find(self.a2.name, self.a2.email)

        expected = "\n".join([
            "## Authors (2)",
            "***",
            ""
        ])

        expected += str(self.a1)
        expected += "\n***\n"
        expected += str(self.a2)
        expected += "\n***\n"

        eq_(expected, str(self.sut))
 def setup(self):
     self.a1 = Author("Bob Dole", "*****@*****.**")
     self.a2 = Author("Joe Schmoe", "*****@*****.**")
     self.sut = Authors()