| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# |
| 3 |
# Copyright (c) 2019, the cclib development team |
| 4 |
# |
| 5 |
# This file is part of cclib (http://cclib.github.io) and is distributed under |
| 6 |
# the terms of the BSD 3-Clause License. |
| 7 |
|
| 8 |
"""Unit tests for general file writer.""" |
| 9 |
|
| 10 |
import inspect |
| 11 |
import os |
| 12 |
import unittest |
| 13 |
|
| 14 |
import cclib |
| 15 |
|
| 16 |
|
| 17 |
__filedir__ = os.path.dirname(__file__) |
| 18 |
__filepath__ = os.path.realpath(__filedir__) |
| 19 |
__datadir__ = os.path.join(__filepath__, "..", "..") |
| 20 |
|
| 21 |
|
| 22 |
class FileWriterTest(unittest.TestCase): |
| 23 |
|
| 24 |
def test_init(self): |
| 25 |
"""Does the class initialize properly?""" |
| 26 |
|
| 27 |
# You cannot instantiate a class with abstract methods. |
| 28 |
fpath = os.path.join(__datadir__, "data/ADF/basicADF2007.01/dvb_gopt.adfout") |
| 29 |
data = cclib.io.ccread(fpath) |
| 30 |
with self.assertRaises(TypeError): |
| 31 |
cclib.io.filewriter.Writer(data) |
| 32 |
|
| 33 |
|
| 34 |
if __name__ == "__main__": |
| 35 |
unittest.main() |