Skip to content
This repository was archived by the owner on Mar 30, 2026. It is now read-only.

Commit c1a735f

Browse files
committed
Rename module
1 parent 3d1dbd7 commit c1a735f

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

tests/test_directorysync.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
"""Tests for DirectorySyncService."""
5+
6+
import os
7+
import sys
8+
9+
import pytest
10+
11+
curpath = os.path.dirname(os.path.abspath(__file__))
12+
sys.path[:0] = [os.path.join(curpath, os.pardir)]
13+
14+
from pancloud.directorysync import DirectorySyncService
15+
from pancloud.httpclient import HTTPClient
16+
from pancloud.exceptions import RequiredKwargsError, \
17+
UnexpectedKwargsError
18+
19+
20+
TARPIT = os.environ.get('TARPIT', 'http://10.255.255.1')
21+
22+
23+
class TestLoggingService:
24+
25+
def test_entry_points(self):
26+
27+
DirectorySyncService(url=TARPIT).session
28+
DirectorySyncService(url=TARPIT).kwargs
29+
DirectorySyncService(url=TARPIT).url
30+
DirectorySyncService(url=TARPIT).attributes
31+
DirectorySyncService(url=TARPIT).query
32+
DirectorySyncService(url=TARPIT).domains
33+
DirectorySyncService(url=TARPIT).count
34+
35+
def test_repr(self):
36+
assert repr(
37+
DirectorySyncService(url='http://', verify=False)
38+
) == "DirectorySyncService(url='http://', verify=False)"
39+
40+
def test_required_kwargs(self):
41+
with pytest.raises(RequiredKwargsError):
42+
DirectorySyncService()
43+
44+
with pytest.raises(RequiredKwargsError):
45+
DirectorySyncService(session=None)
46+
47+
def test_unexpected_kwargs(self):
48+
with pytest.raises(UnexpectedKwargsError):
49+
DirectorySyncService(url=TARPIT, foo='foo')
50+
51+
def test_session(self):
52+
session = HTTPClient(url=TARPIT)
53+
DirectorySyncService(session=session)

0 commit comments

Comments
 (0)