FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
osquery-python/tests/test_singleton.py at master · osquery/osquery-python · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
osquery
/
osquery-python
Public
Notifications
You must be signed in to change notification settings
Fork
52
Star
308
Code
Issues
16
Pull requests
1
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
osquery-python
/
tests
/
test_singleton.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (27 loc) · 1.07 KB
Breadcrumbs
osquery-python
/
tests
/
test_singleton.py
Copy path
File metadata and controls
36 lines (27 loc) · 1.07 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
# pylint: disable=too-few-public-methods
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
unicode_literals
import
os
import
sys
import
unittest
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"../build/lib/"
)))
import
osquery
class
TestSingleton
(
unittest
.
TestCase
):
"""Tests for osquery.Singleton"""
class
MockSingleton
(
osquery
.
Singleton
):
"""Mock singleton class for testing"""
pass
def
test_singleton_creation
(
self
):
"""Test that two singletons are the same object"""
singleton_a
=
self
.
MockSingleton
()
singleton_b
=
self
.
MockSingleton
()
self
.
assertEqual
(
id
(
singleton_a
),
id
(
singleton_b
))
if
__name__
==
'__main__'
:
unittest
.
main
()
Back
|
FazBrowse Home
|
New Git URL