def test_empty_role(self):
     node = MagicMock()
     result = MagicMock()
     result.stdout = "\n"
     node.run.return_value = result
     self.assertEqual(
         postgres_roles.get_role(node, "bw"),
         {},
     )
    def test_get_role(self):
        node = MagicMock()
        result = MagicMock()
        result.stdout = """rolsuper|f
rolpassword|foo
"""
        node.run.return_value = result
        self.assertEqual(
            postgres_roles.get_role(node, "bw"),
            {
                'superuser': False,
                'password_hash': "foo",
            },
        )