<commit_before>from datetime import datetime

import api
from project import Project


class Suite(object):
    def __init__(self, content):
        self._content = content
        self.api = api.API()

    @property
    def id(self):
        return self._content.get('id')

    @property
    def completed_on(self):
        try:
            return datetime.fromtimestamp(
                int(self._content.get('completed_on')))
        except TypeError:
            return None

    @property
    def description(self):
        return self._content.get('description')

    @property
    def is_baseline(self):
        return self._content.get('is_baseline')

    @property
    def is_completed(self):
        return self._content.get('is_completed')

    @property
    def is_master(self):
        return self._content.get('is_master')

    @property
    def name(self):
        return self._content.get('name')

    @property
    def project(self):
        return Project(
            self.api.project_with_id(self._content.get('project_id')))

    @property
    def url(self):
        return self._content.get('url')
<commit_msg>Add setters for project, name, and description.<commit_after>from datetime import datetime

import api
from helper import TestRailError
from project import Project


class Suite(object):
    def __init__(self, content):
        self._content = content
        self.api = api.API()

    @property
    def id(self):
        return self._content.get('id')

    @property
    def completed_on(self):
        try:
            return datetime.fromtimestamp(
                int(self._content.get('completed_on')))
        except TypeError:
            return None

    @property
    def description(self):
        return self._content.get('description')

    @description.setter
    def description(self, value):
        if type(value) != str:
            raise TestRailError('input must be a string')
        self._content['description'] = value

    @property
    def is_baseline(self):
        return self._content.get('is_baseline')

    @property
    def is_completed(self):
        return self._content.get('is_completed')

    @property
    def is_master(self):
        return self._content.get('is_master')

    @property
    def name(self):
        return self._content.get('name')

    @name.setter
    def name(self, value):
        if type(value) != str:
            raise TestRailError('input must be a string')
        self._content['name'] = value

    @property
    def project(self):
        return Project(
            self.api.project_with_id(self._content.get('project_id')))

    @project.setter
    def project(self, value):
        if type(value) != Project:
            raise TestRailError('input must be a Project')
        self.api.project_with_id(value.id)  # verify project is valid
        self._content['project_id'] = value.id

    @property
    def url(self):
        return self._content.get('url')

    def raw_data(self):
        return self._content

{'fraction_non_alphanumeric': 0.1052456839309429, 'fraction_numerical': 0.0, 'mean_word_length': 2.4122310305775763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6371887', 'n_tokens_mistral': 867, 'n_tokens_neox': 826, 'n_words': 206}