-
Notifications
You must be signed in to change notification settings - Fork 9
/
test-gp.py
executable file
·69 lines (57 loc) · 2.07 KB
/
test-gp.py
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/python
# test-gp.py - test suite for libgphoto2 bindings
# Copyright (C) 2006,2007 Hans Ulrich Niedermann <[email protected]>
# Best used with Makefile's "installcheck" targets.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import sys
import os
from pprint import pprint
import unittest
import modulefinder
class TestRunner(unittest.TestCase):
def setUp(self):
import gphoto2
def test_000_version_short(self):
import gphoto2
#print "gphoto2 version", gphoto2.version()
def test_010_ports(self):
import gphoto2
self.ports = gphoto2.ports()
self.ports.load()
print self.ports.count(), " ports found:"
for port in range(0, self.ports.count()):
print self.ports[port]
def xtest_020_cameras(self):
import gphoto2
self.a_l = gphoto2.abilities_list()
self.a_l.load()
print self.a_l.count(), " cameras found:"
for i in range(0, self.a_l.count()):
print self.a_l[i]
def test_030_camera(self):
import gphoto2
print("Creating camera...")
self.cam = gphoto2.camera()
pprint(dir(self.cam))
def test_007_long(self):
import gphoto2
pprint(gphoto2.library_version(False))
pprint(gphoto2.library_version(True))
def test_050_foo(self):
import gphoto2
pprint(dir(gphoto2))
if __name__ == '__main__':
unittest.main()