<commit_before># vi:filetype=

my $ExePath;
BEGIN {
    use FindBin;
    $ExePath = "$FindBin::Bin/../haskell/bin/restyscript";
    if (!-f $ExePath) {
        $skip = "$ExePath is not found.\n";
        return;
    }
    if (!-x $ExePath) {
        $skip = "$ExePath is not an executable.\n";
        return;
    }
};
use t::OpenResty $skip ? (skip_all => $skip) : ();

plan tests => 3 * blocks();

run_tests;

__DATA__





=== TEST 1: Delete existing models
--- request
DELETE /=/model?_user=$TestAccount&_password=$<PASSWORD>&_use_cookie=1
--- response
{"success":1}



=== TEST 2: Delete existing views
--- request
DELETE /=/view
--- response
{"success":1}



=== TEST 3: Check the view list
--- request
GET /=/view
--- response
[]



=== TEST 4: Create model A
--- request
POST /=/model/A<commit_msg>1、create view with duplicate name 2、create view with duplicate definition<commit_after>﻿# vi:filetype=

use t::OpenResty;

plan tests => 3 * blocks();

run_tests;

__DATA__




=== TEST 1: Delete existing models
--- request
DELETE /=/model?_user=$TestAccount&_password=$<PASSWORD>&_use_cookie=1
--- response
{"success":1}



=== TEST 2: Delete existing views
--- request
DELETE /=/view
--- response
{"success":1}



=== TEST 3: Check the view list
--- request
GET /=/view
--- response
[]



=== TEST 4: Create model A
--- request
POST /=/model/A
{'fraction_non_alphanumeric': 0.17838638045891933, 'fraction_numerical': 0.013323464100666173, 'mean_word_length': 3.0118694362017804, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3255519', 'n_tokens_mistral': 490, 'n_tokens_neox': 448, 'n_words': 133}