#!/usr/bin/python

import unittest
import os
import pymatgen.electronic_structure.band_structure
from pymatgen.electronic_structure.band_structure.band_structure import BandStructureSymmLine
from pymatgen.electronic_structure.band_structure.plotter import BSPlotter

module_dir = os.path.dirname(os.path.abspath(__file__))

class BSPlotterTest(unittest.TestCase):

    def setUp(self):  
        import json
        with open(os.path.join(module_dir,"CaO_2605.json"), "rb") as f:
            dict=json.loads(f.read())
            self.bs=pymatgen.electronic_structure.band_structure.band_structure.BandStructureSymmLine.from_dict(dict)
            self.plotter=BSPlotter(self.bs)
            
    def test_bs_plot_data(self):
        self.assertEqual(len(self.plotter.bs_plot_data['distances']), 160, "wrong number of distances")
        self.assertEqual(self.plotter.bs_plot_data['ticks']['label'][5], "K", "wrong tick label")
        self.assertEqual(len(self.plotter.bs_plot_data['ticks']['label']), 19, "wrong number of tick labels")

if __name__ == '__main__':
    unittest.main()
@@ -719,16 +719,25 @@
 (self):%0A
+        %0A
         
@@ -782,16 +782,18 @@
 lot_data
+()
 %5B'distan
@@ -876,32 +876,34 @@
 ter.bs_plot_data
+()
 %5B'ticks'%5D%5B'label
@@ -988,16 +988,18 @@
 lot_data
+()
 %5B'ticks'

update test_plotter for the changes in the band structure object