summaryrefslogtreecommitdiff
path: root/python/samba
diff options
context:
space:
mode:
authorLumir Balhar <lbalhar@redhat.com>2016-10-18 14:30:28 +0200
committerGarming Sam <garming@samba.org>2016-11-06 23:53:10 +0100
commitba060f862388e482beffe349baf02b559fc8dffd (patch)
treec883f75f340c19a81ddd583d682529f73ce1c295 /python/samba
parent815658d2db46e4accdd35f5925585ec1f1c3d74f (diff)
downloadsamba-ba060f862388e482beffe349baf02b559fc8dffd.tar.gz
python: samba.tests.credentials: Fix DeprecationWarning
For historical reasons, TestCase methods have some aliases which are deprecated since Python 2.7. Change "assertEquals" to the preferred name, "assertEqual". Deprecation notice: https://docs.python.org/2/library/unittest.html#deprecated-aliases Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python/samba')
-rw-r--r--python/samba/tests/credentials.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/python/samba/tests/credentials.py b/python/samba/tests/credentials.py
index 95ee0fa0deb..2afc2307da1 100644
--- a/python/samba/tests/credentials.py
+++ b/python/samba/tests/credentials.py
@@ -32,35 +32,35 @@ class CredentialsTests(samba.tests.TestCase):
def test_set_username(self):
self.creds.set_username("somebody")
- self.assertEquals("somebody", self.creds.get_username())
+ self.assertEqual("somebody", self.creds.get_username())
def test_set_password(self):
self.creds.set_password("S3CreT")
- self.assertEquals("S3CreT", self.creds.get_password())
+ self.assertEqual("S3CreT", self.creds.get_password())
def test_set_domain(self):
self.creds.set_domain("ABMAS")
- self.assertEquals("ABMAS", self.creds.get_domain())
+ self.assertEqual("ABMAS", self.creds.get_domain())
def test_set_realm(self):
self.creds.set_realm("myrealm")
- self.assertEquals("MYREALM", self.creds.get_realm())
+ self.assertEqual("MYREALM", self.creds.get_realm())
def test_parse_string_anon(self):
self.creds.parse_string("%")
- self.assertEquals("", self.creds.get_username())
- self.assertEquals(None, self.creds.get_password())
+ self.assertEqual("", self.creds.get_username())
+ self.assertEqual(None, self.creds.get_password())
def test_parse_string_user_pw_domain(self):
self.creds.parse_string("dom\\someone%secr")
- self.assertEquals("someone", self.creds.get_username())
- self.assertEquals("secr", self.creds.get_password())
- self.assertEquals("DOM", self.creds.get_domain())
+ self.assertEqual("someone", self.creds.get_username())
+ self.assertEqual("secr", self.creds.get_password())
+ self.assertEqual("DOM", self.creds.get_domain())
def test_bind_dn(self):
- self.assertEquals(None, self.creds.get_bind_dn())
+ self.assertEqual(None, self.creds.get_bind_dn())
self.creds.set_bind_dn("dc=foo,cn=bar")
- self.assertEquals("dc=foo,cn=bar", self.creds.get_bind_dn())
+ self.assertEqual("dc=foo,cn=bar", self.creds.get_bind_dn())
def test_is_anon(self):
self.creds.set_username("")
@@ -72,14 +72,14 @@ class CredentialsTests(samba.tests.TestCase):
def test_workstation(self):
# FIXME: This is uninitialised, it should be None
- #self.assertEquals(None, self.creds.get_workstation())
+ #self.assertEqual(None, self.creds.get_workstation())
self.creds.set_workstation("myworksta")
- self.assertEquals("myworksta", self.creds.get_workstation())
+ self.assertEqual("myworksta", self.creds.get_workstation())
def test_get_nt_hash(self):
self.creds.set_password("geheim")
- self.assertEquals('\xc2\xae\x1f\xe6\xe6H\x84cRE>\x81o*\xeb\x93',
- self.creds.get_nt_hash())
+ self.assertEqual('\xc2\xae\x1f\xe6\xe6H\x84cRE>\x81o*\xeb\x93',
+ self.creds.get_nt_hash())
def test_guess(self):
# Just check the method is there and doesn't raise an exception