def test_basename(self): n = StackFrameNamer() self.assertTrue(n.get_basename().endswith("NamerTests.test_basename"), n.get_basename())
def setUp(self): self.namer = StackFrameNamer()
def get_default_namer(extension=None): return StackFrameNamer(extension)
def test_method(self): n = StackFrameNamer() self.assertEqual("test_method", n.get_method_name())
def get_default_namer(extension: Optional[str] = None) -> StackFrameNamer: return StackFrameNamer(extension)
def test_class(self): self.assertEqual("NamerTests", StackFrameNamer().get_class_name())
def test_approved_name(self): filename = StackFrameNamer().get_approved_filename("./stuff") self.assertEqual(filename, "./stuff.approved.txt")
def test_file(self): directory = StackFrameNamer().get_directory() assert os.path.exists(directory + "/test_namer.py")
def an_other_method(self): n = StackFrameNamer() self.assertEqual( "test_name_works_from_inside_an_other_method", n.get_method_name() )