Пример #1
0
def test_k8s_node_list_wo_label_selector():
    mock = MagicMock()
    with patch('intel.k8s.client_from_config', MagicMock(return_value=mock)):
        k8s.get_node_list(None)
        called_methods = mock.method_calls
        assert len(called_methods) == 1
        assert called_methods[0][0] == "list_node"
        kargs = called_methods[0][2]
        assert "label_selector" not in kargs
Пример #2
0
def test_k8s_node_list_wo_label_selector():
    mock = MagicMock()
    with patch(CLIENT_CONFIG, MagicMock(return_value=mock)):
        k8s.get_node_list(None)
        called_methods = mock.method_calls
        assert len(called_methods) == 1
        assert called_methods[0][0] == "list_node"
        kargs = called_methods[0][2]
        assert "label_selector" not in kargs