def test_clean_variable_name_returns_valid_variable_names(self):
     invalid_variable_names = ["2GEM_log", "GEM-log", "GEM*log", "GEM+log"]
     for var_name in invalid_variable_names:
         clean_name = clean_variable_name(var_name)
         try:
             parse("{} = None".format(clean_name))
         except (SyntaxError, TypeError, ValueError):
             msg = "Invalid variable name: {}".format(clean_name)
             self.fail(msg)
예제 #2
0
def get_plot_command_pos_args(artist):
    ax = artist.axes
    ws_name = ax.get_artists_workspace_and_spec_num(artist)[0].name()
    return [clean_variable_name(ws_name)]