Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

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

# -*- coding: utf-8 -*- 

""" 

The obspy.imaging.backend test suite. 

""" 

 

import matplotlib 

import unittest 

 

 

class BackendTestCase(unittest.TestCase): 

    """ 

    Test cases for matplotlib backend. 

 

    Note: This test will fail when called from an interactive Python session 

    where matplotlib was already imported. 

    """ 

    def test_Backend(self): 

        """ 

        Test to see if tests are running without any X11 or any other display 

        variable set. Therefore, the AGG backend is chosen in 

        obspy.imaging.tests.__init__, and nothing must be imported before, 

        e.g. by obspy.imaging.__init__. The AGG backend does not require and 

        display setting. It is therefore the optimal for programs on servers 

        etc. 

        """ 

        self.assertEqual('AGG', matplotlib.get_backend().upper()) 

 

 

def suite(): 

    return unittest.makeSuite(BackendTestCase, 'test') 

 

 

if __name__ == '__main__': 

    unittest.main(defaultTest='suite')