@patch('salt.modules.hosts._list_hosts',
           MagicMock(return_value={'10.10.10.10': ['Salt1', 'Salt2']}))
    def test_get_ip(self):
        self.assertEqual('10.10.10.10', hosts.get_ip('Salt1'))

        self.assertEqual('', hosts.get_ip('Salt3'))
Store the user data to the session
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/hosts_test.py/HostsTestCase.test_get_ip--crossover with--dataset/ETHPy150Open flashingpumpkin/django-socialregistration/socialregistration/mixins.py/SessionMixin.store_user