示例#1
0
    def test_get_strict_no_profile_in_config(self):
        """
        Test if SaltInvocationError exception will be raised if we
        don't have expected profile in the minion config
        """

        msg = 'SDB profile "salt" wasnt found in the minion configuration'
        with self.assertRaisesRegex(SaltInvocationError, msg) as cm:
            sdb.get("sdb://salt/foo", strict=True)
示例#2
0
    def test_get_strict_no_profile(self):
        """
        Test if SaltInvocationError exception will be raised if we
        don't have a valid profile in the uri
        """

        msg = "SDB uri must have a profile name as a first part of the uri before the /"
        with self.assertRaisesRegex(SaltInvocationError, msg) as cm:
            sdb.get("sdb://salt", strict=True)
示例#3
0
    def test_get_strict_no_sdb_in_uri(self):
        """
        Test if SaltInvocationError exception will be raised if we
        don't start uri with sdb://
        """

        msg = 'SDB uri must start with "sdb://"'
        with self.assertRaisesRegex(SaltInvocationError, msg) as cm:
            sdb.get("://salt/foo", strict=True)
示例#4
0
def test_get_strict_no_sdb_in_uri():
    """
    Test if SaltInvocationError exception will be raised if we
    don't start uri with sdb://
    """

    msg = 'SDB uri must start with "sdb://"'
    with pytest.raises(SaltInvocationError, match=msg) as cm:
        sdb.get("://salt/foo", strict=True)
示例#5
0
文件: test_sdb.py 项目: cldeluna/salt
 def test_get(self):
     '''
     Test if it gets a value from a db, using a uri in the form of
     sdb://<profile>/<key>
     '''
     self.assertEqual(sdb.get('sdb://salt/foo'), 'sdb://salt/foo')
示例#6
0
文件: sdb_test.py 项目: DaveQB/salt
 def test_get(self):
     '''
     Test if it gets a value from a db, using a uri in the form of
     sdb://<profile>/<key>
     '''
     self.assertEqual(sdb.get('sdb://salt/foo'), 'sdb://salt/foo')
示例#7
0
 def test_get(self):
     """
     Test if it gets a value from a db, using a uri in the form of
     sdb://<profile>/<key>
     """
     self.assertEqual(sdb.get("sdb://salt/foo"), "sdb://salt/foo")
示例#8
0
def test_get():
    """
    Test if it gets a value from a db, using a uri in the form of
    sdb://<profile>/<key>
    """
    assert sdb.get("sdb://salt/foo") == "sdb://salt/foo"