source: ndgCommon/trunk/ndg/common/unittests/testutils.py @ 4793

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/ndgCommon/trunk/ndg/common/unittests/testutils.py@4844
Revision 4793, 1013 bytes checked in by cbyrom, 11 years ago (diff)

Checking in initial codebase for ndgUtils restructure.

Line 
1"""
2Utilities to use in the various test cases
3
4NERC Data Grid Project
5"""
6__author__ = "C Byrom - Tessella"
7__date__ = "16/12/08"
8__copyright__ = "(C) 2008 STFC & NERC"
9__license__ = \
10"""This software may be distributed under the terms of the Q Public
11License, version 1.0 or later."""
12__contact__ = "b.n.lawrence@rl.ac.uk"
13__revision__ = '$Id: $'
14
15from ndg.common.src.models.vocabtermdata import VocabTermData as VTD
16import ndg.common.src.clients.xmldb.eXist.existdbclient as dbc
17from ndg.common.src.models.Atom import Atom
18
19class testUtils(object):
20    def __init__(self, confFile):
21        self.dbc = dbc.eXistDBClient(configFile = confFile, setUpDB = True)
22   
23    def createAtom(self, content):
24        atom = Atom(VTD.GRANULE_TERM)
25        atom.fromString(content)
26        return atom
27   
28    def createAtomInEXist(self, content):
29        atom = self.createAtom(content)
30        return self.dbc.createAtomInExist(atom)
31   
32    def deleteAtomInExist(self, path):
33        self.dbc.deleteEXistFile(path)
Note: See TracBrowser for help on using the repository browser.