Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-05-17 11:08:52 +0300
committerCampbell Barton <campbell@blender.org>2022-05-17 11:11:16 +0300
commitbdb5a506824f7d173be41f4f6cae113213072243 (patch)
tree92202479e60cfbd28ab8892222f0a5f22fa53e92 /tests
parenta4ed0f51c1560436a4e4f9b9dcd7cb048b4b2397 (diff)
Update tests to account for Text.as_string not adding a trailing newline
Regression in tests from [0] tests were written to assume a newline was added to the result of Text.as_string which is no longer the case. [0]: f4ff36431ccfac2f0a99fc23c18fe0d9de38b36d
Diffstat (limited to 'tests')
-rw-r--r--tests/python/bl_pyapi_text.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/python/bl_pyapi_text.py b/tests/python/bl_pyapi_text.py
index 0d8987fb69d..95b83f54772 100644
--- a/tests/python/bl_pyapi_text.py
+++ b/tests/python/bl_pyapi_text.py
@@ -17,11 +17,11 @@ class TestText(unittest.TestCase):
def test_text_new(self):
self.assertEqual(len(bpy.data.texts), 1)
self.assertEqual(self.text.name, "test_text")
- self.assertEqual(self.text.as_string(), "\n")
+ self.assertEqual(self.text.as_string(), "")
def test_text_clear(self):
self.text.clear()
- self.assertEqual(self.text.as_string(), "\n")
+ self.assertEqual(self.text.as_string(), "")
def test_text_fill(self):
tmp_text = (
@@ -30,7 +30,7 @@ class TestText(unittest.TestCase):
"Line 3: test line 3"
)
self.text.write(tmp_text)
- self.assertEqual(self.text.as_string(), tmp_text + "\n")
+ self.assertEqual(self.text.as_string(), tmp_text)
def test_text_region_as_string(self):
tmp_text = (
@@ -53,10 +53,10 @@ class TestText(unittest.TestCase):
self.text.write(tmp_text)
# Set string in the middle of the text.
self.text.region_from_string("line 2", range=((1, 0), (1, -1)))
- self.assertEqual(self.text.as_string(), tmp_text.replace("Line 2: test line 2", "line 2") + "\n")
+ self.assertEqual(self.text.as_string(), tmp_text.replace("Line 2: test line 2", "line 2"))
# Large range test.
self.text.region_from_string("New Text", range=((-10000, -10000), (10000, 10000)))
- self.assertEqual(self.text.as_string(), "New Text\n")
+ self.assertEqual(self.text.as_string(), "New Text")
if __name__ == "__main__":