Пример #1
0
    def test_version(self):
        """
        Test the version returned from OSQuery
        """
        _table_attrs_results = [
            "pid",
            "uuid",
            "instance_id",
            "version",
            "config_hash",
            "config_valid",
            "extensions",
            "build_platform",
            "build_distro",
            "start_time",
            "watcher",
        ]

        _os_query_results = {"data": [{"version": "2.6.1"}], "result": True}

        with patch.object(osquery, "_table_attrs",
                          MagicMock(return_value=_table_attrs_results)):
            with patch.object(osquery, "_osquery",
                              MagicMock(return_value=_os_query_results)):
                self.assertEqual(osquery.version(), "2.6.1")
Пример #2
0
    def test_version(self):
        '''
        Test the version returned from OSQuery
        '''
        _table_attrs_results = [
            'pid', 'uuid', 'instance_id', 'version', 'config_hash',
            'config_valid', 'extensions', 'build_platform', 'build_distro',
            'start_time', 'watcher'
        ]

        _os_query_results = {'data': [{'version': '2.6.1'}], 'result': True}

        with patch.object(osquery, '_table_attrs',
                          MagicMock(return_value=_table_attrs_results)):
            with patch.object(osquery, '_osquery',
                              MagicMock(return_value=_os_query_results)):
                self.assertEqual(osquery.version(), '2.6.1')