def test_magres_plot(self):
    (magres, f) = magres2dict((REAL_PATH + 'data/magres_files/*P*.magres'), as_model=True)
    plot_magres(magres, species='P', savefig='magres_P.pdf', line_kwargs={'c': 'green'})
    self.assertTrue(os.path.isfile('magres_P.pdf'))
    plot_magres(magres, species='Li', broadening_width=0, magres_key='chemical_shift_aniso', savefig='magres_Li.png', signal_labels=['NaP', 'LiP'], line_kwargs=[{'lw': 3}, {'ls': '--'}])
    self.assertTrue(os.path.isfile('magres_Li.png'))
    with self.assertRaises(RuntimeError):
        plot_magres(magres, species=None)
    with self.assertRaises(RuntimeError):
        plot_magres(magres, species='K')
def test_magres_plot(self):
    (magres, f) = magres2dict((REAL_PATH + 'data/magres_files/*P*.magres'), as_model=True)
    plot_magres(magres, species='P', savefig='magres_P.pdf', line_kwargs={'c': 'green'})
    self.assertTrue(os.path.isfile('magres_P.pdf'))
    plot_magres(magres, species='Li', broadening_width=0, magres_key='chemical_shift_aniso', savefig='magres_Li.png', signal_labels=['NaP', 'LiP'], line_kwargs=[{'lw': 3}, {'ls': '--'}])
    self.assertTrue(os.path.isfile('magres_Li.png'))
    with self.assertRaises(RuntimeError):
        plot_magres(magres, species=None)
    with self.assertRaises(RuntimeError):
        plot_magres(magres, species='K')