summaryrefslogtreecommitdiffhomepage
path: root/tests/12_test_deb.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-08-02 11:13:38 -0300
committerGuido Günther <agx@sigxcpu.org>2017-08-02 11:56:15 -0300
commita597bafbd34e8e14d5084410a4298e87df8f3240 (patch)
tree8aa4ea6774c0b32ffc13f20955680fc33e37c845 /tests/12_test_deb.py
parentf009dd091a724e7b793c324f546a23d62dc734b5 (diff)
Test dpkg helpers
so we don't end up with bytes instead of str
Diffstat (limited to 'tests/12_test_deb.py')
-rw-r--r--tests/12_test_deb.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/12_test_deb.py b/tests/12_test_deb.py
index 25c7ab1f..ee14fbb5 100644
--- a/tests/12_test_deb.py
+++ b/tests/12_test_deb.py
@@ -3,9 +3,11 @@
"""Test L{gbp.deb}"""
from . import context # noqa: 401
+from . import testutils
import os
import tempfile
+import platform
import unittest
import gbp.deb
@@ -139,3 +141,20 @@ class TestDpkgCompareVersions(unittest.TestCase):
def testBadVersion(self):
self.assertRaises(CommandExecFailed, self.cmp, '_', '_ _')
+
+
+@unittest.skipIf(not os.path.exists('/usr/bin/dpkg'), 'Dpkg not found')
+class TestDeb(unittest.TestCase):
+ """Test L{gbp.deb.__init__} """
+
+ @unittest.skipUnless(platform.machine() == "x86_64", "not on amd64")
+ def test_get_arch(self):
+ arch = gbp.deb.get_arch()
+ self.assertTrue(isinstance(arch, str))
+ self.assertEquals(arch, "amd64")
+
+ @unittest.skipUnless(testutils.OsReleaseFile()['ID'] == 'debian', "not on Debian")
+ def test_get_vendor(self):
+ vendor = gbp.deb.get_vendor()
+ self.assertTrue(isinstance(vendor, str))
+ self.assertEquals(vendor, "Debian")