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