diff options
author | Chad Smith <chad.smith@canonical.com> | 2017-10-10 12:58:19 -0600 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2017-10-10 12:58:19 -0600 |
commit | d4f70470b7c3af89d4bf97123f4d61ad8a58805b (patch) | |
tree | 380ae0d12c9aec39f0ea05d600d6031ae58ceb46 /cloudinit/tests/test_simpletable.py | |
parent | 45d361cb0b7f5e4e7d79522bd285871898358623 (diff) | |
download | vyos-cloud-init-d4f70470b7c3af89d4bf97123f4d61ad8a58805b.tar.gz vyos-cloud-init-d4f70470b7c3af89d4bf97123f4d61ad8a58805b.zip |
simpletable: Fix get_string method to return table-formatted string
Output in cloud-init-output.log contained only the string representation
of a SimpleTable object instead of the table formatted content. This bug
also affected ssh_authkey_fingerprints.
LP: #1722566
Diffstat (limited to 'cloudinit/tests/test_simpletable.py')
-rw-r--r-- | cloudinit/tests/test_simpletable.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cloudinit/tests/test_simpletable.py b/cloudinit/tests/test_simpletable.py index 96bc24cf..a12a62a0 100644 --- a/cloudinit/tests/test_simpletable.py +++ b/cloudinit/tests/test_simpletable.py @@ -97,4 +97,10 @@ class TestSimpleTable(CiTestCase): table = SimpleTable(AUTHORIZED_KEYS_FIELDS) for row in AUTHORIZED_KEYS_ROWS: table.add_row(row) - self.assertEqual(str(table), AUTHORIZED_KEYS_TABLE) + + def test_get_string(self): + """get_string() method returns the same content as str().""" + table = SimpleTable(AUTHORIZED_KEYS_FIELDS) + for row in AUTHORIZED_KEYS_ROWS: + table.add_row(row) + self.assertEqual(table.get_string(), str(table)) |