def new_string(self, embedded_string): # Allocate a new string and set its class to be the string class result = String(self._nilObject, embedded_string) result.set_class(self._stringClass) # Return the freshly allocated string return result
class StringTestCase(unittest.TestCase): def setUp(self): self.string = String(Object(None), "test") def test_get_embedded_string(self): self.assertEqual("test", self.string.get_embedded_string()) def test_str(self): self.assertEqual("\'test\'", str(self.string))
def new_string(embedded_string): return String(embedded_string)
def setUp(self): self.string = String(Object(None), "test")
def __init__(self, value): String.__init__(self, value) self._number_of_signature_arguments = self._determine_number_of_signature_arguments( ) # updated later
def __init__(self, value): String.__init__(self, value) self._number_of_signature_arguments = self._determine_number_of_signature_arguments() # updated later