[elbe-devel] [PATCH v2 0/9] Elbe unit testing

Torben Hohn torben.hohn at linutronix.de
Thu May 14 16:45:19 CEST 2020


On Wed, May 13, 2020 at 11:34:08AM -0400, Olivier Dion wrote:
> The following changes since commit dc9b6e81da58e9aa0968cad4b82d1727fe1d9062:
> 
>   debian changelog: bump version to 12.4 (2020-04-30 12:27:02 +0200)
> 
> are available in the Git repository at:
> 
>   git at lxcvs:linutronix/elbe/elbe.git devel/dion/unittests
> 
> for you to fetch changes up to 9ded37784c6dfb831aeeacaccb95525ae279aefc:
> 
>   filesystem: Handle sysmlinks for w/r/a operations (2020-05-13 11:26:21 -0400)
> 
> ----------------------------------------------------------------
> Olivier Dion (6):
>       commands test: Create Elbe unit test wrapper
>       tests efilesystem: Test for multiple symlinks for copy_filelist
>       tests efilesystem: Test bad file for copy_filelist
>       efilesystem: Fix copy_filelist to handle symlinks
>       filesystem: Change os.errno to errno module
>       filesystem: Handle sysmlinks for w/r/a operations
> 
> Torben Hohn (3):
>       tests version: Introduction to Elbe unit testing
>       tests efilesystem: Add tests for copy_fileslist
>       tests efilesystem: Add deeplinks test for copy_filelist
> 
>  elbepack/commands/test.py          | 16 +++++++
>  elbepack/efilesystem.py            | 65 +++++++++++++++++++++++------
>  elbepack/filesystem.py             | 27 ++++++------
>  elbepack/tests/__init__.py         |  0
>  elbepack/tests/test_efilesystem.py | 85 ++++++++++++++++++++++++++++++++++++++
>  elbepack/tests/test_version.py     | 32 ++++++++++++++
>  6 files changed, 200 insertions(+), 25 deletions(-)
>  create mode 100644 elbepack/commands/test.py
>  create mode 100644 elbepack/tests/__init__.py
>  create mode 100644 elbepack/tests/test_efilesystem.py
>  create mode 100644 elbepack/tests/test_version.py
> -- 
> Olivier Dion
> Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen


merged it to master, thanks.

I get this for the version tests:

------------------------------------------------------------------------------------------------------
-> ./elbe test
sh: dmidecode: command not found
cp: cannot stat '/tmp/tmpLmqBi2/doesnt': No such file or directory
x....EE
======================================================================
ERROR: test_mutable_state (elbepack.tests.test_version.TestElbepackVersion)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/functools.py", line 33, in update_wrapper
    setattr(wrapper, attr, getattr(wrapped, attr))
AttributeError: 'TestElbepackVersion' object has no attribute '__name__'

======================================================================
ERROR: test_version (elbepack.tests.test_version.TestElbepackVersion)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/functools.py", line 33, in update_wrapper
    setattr(wrapper, attr, getattr(wrapped, attr))
AttributeError: 'TestElbepackVersion' object has no attribute '__name__'

----------------------------------------------------------------------
Ran 7 tests in 0.013s

FAILED (errors=2, expected failures=1)
------------------------------------------------------------------------------------------------------


Dont skip the version test.

Please bump the version to 12.4, and remove the list test

------------------------------------------------------------------------------------------------------
diff --git a/elbepack/tests/test_version.py b/elbepack/tests/test_version.py
index e29681fdf..851b1c259 100644
--- a/elbepack/tests/test_version.py
+++ b/elbepack/tests/test_version.py
@@ -12,7 +12,7 @@ from elbepack.version import elbe_version
 class TestElbepackVersion(unittest.TestCase):
 
     # This is a read-only state that is the same for every tests
-    expected_version = "12.3"
+    expected_version = "12.4"
 
     def setUp(self):
         # This is a mutable state that is different for every tests
@@ -22,11 +22,5 @@ class TestElbepackVersion(unittest.TestCase):
         # You might want to cleanup your mutable states here
         pass
 
-    @unittest.skip
     def test_version(self):
-        self.my_list.append(1)
         self.assertEqual(elbe_version, self.expected_version)
-
-    @unittest.skip
-    def test_mutable_state(self):
-        self.assertEqual(len(self.my_list), 0)
------------------------------------------------------------------------------------------------------

> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner



More information about the elbe-devel mailing list